diff --git a/tools/shell/inc/shellInt.h b/tools/shell/inc/shellInt.h index 113853bd8397fe194d0efc65a55f73f2aa865929..08d4b167ea45ceee5e1f45c220d98ac8d6fed8bd 100644 --- a/tools/shell/inc/shellInt.h +++ b/tools/shell/inc/shellInt.h @@ -83,7 +83,7 @@ typedef struct { const char *clientVersion; char cusName[32]; char promptHeader[32]; - const char* promptContinue; + char promptContinue[32]; const char* osname; int32_t promptSize; char programVersion[256]; diff --git a/tools/shell/src/shellArguments.c b/tools/shell/src/shellArguments.c index 19275cce8228ff280b262c87e044a770f6a6a00d..636138fac70041388a7a7383936c8bd11648a9e8 100644 --- a/tools/shell/src/shellArguments.c +++ b/tools/shell/src/shellArguments.c @@ -411,7 +411,9 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) { "Copyright (c) 2022 by %s, all rights reserved.\r\n\r\n"; strcpy(shell.info.cusName, cusName); sprintf(shell.info.promptHeader, "%s> ", cusPrompt); - shell.info.promptContinue = TAOS_CONSOLE_PROMPT_CONTINUE; + char promptContinueFormat[32] = {0}; + sprintf(promptContinueFormat, "%%%zus> ", strlen(cusPrompt)); + sprintf(shell.info.promptContinue, promptContinueFormat, " "); shell.info.promptSize = strlen(shell.info.promptHeader); snprintf(shell.info.programVersion, sizeof(shell.info.programVersion), "version: %s compatible_version: %s\ngitinfo: %s\nbuildInfo: %s", version, compatible_version, gitinfo,