From fed3b36b0ea3cf2aceecb4b27d484bc8d8d3f252 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Thu, 23 Jun 2022 09:40:35 +0800 Subject: [PATCH] shell: fix shell chinese error --- tools/shell/src/shellCommand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/shell/src/shellCommand.c b/tools/shell/src/shellCommand.c index ddd4f7a59d..f236c1eb88 100644 --- a/tools/shell/src/shellCommand.c +++ b/tools/shell/src/shellCommand.c @@ -416,6 +416,9 @@ char taosGetConsoleChar() { bufIndex = 0; } if (mbStrLen == 0){ + if (buf[bufIndex] == '\r') { + bufIndex++; + } mbStrLen = WideCharToMultiByte(CP_UTF8, 0, &buf[bufIndex], 1, mbStr, sizeof(mbStr), NULL, NULL); mbStrIndex = 0; bufIndex++; @@ -485,7 +488,6 @@ int32_t shellReadCommand(char *command) { shellBackspaceChar(&cmd); break; case '\n': - break; case '\r': #ifdef WINDOWS #else -- GitLab