fix(shell): fixed chinese input error 1

This commit is contained in:
Alex Duan 2022-10-20 18:46:39 +08:00
parent 892bdb75fc
commit 14c02530b5
1 changed files with 3 additions and 5 deletions

View File

@ -102,11 +102,9 @@ void shellInsertChar(SShellCmd *cmd, char *c, int32_t size) {
/* update the values */
cmd->commandSize += size;
cmd->cursorOffset += size;
for (int i = 0; i < size; i++) {
taosMbToWchar(&wc, c + i, size);
cmd->screenOffset += taosWcharWidth(wc);
cmd->endOffset += taosWcharWidth(wc);
}
cmd->screenOffset += taosWcharWidth(wc);
cmd->endOffset += taosWcharWidth(wc);
// set string end
cmd->command[cmd->commandSize] = 0;
#ifdef WINDOWS