fix(shell): restore zhiqiang modify chinese char show modifing

This commit is contained in:
Alex Duan 2022-10-19 20:14:30 +08:00
parent 720c16bf0a
commit 48069ca974
1 changed files with 5 additions and 2 deletions

View File

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