Merge pull request #17300 from taosdata/fix/ZhiqiangWang/TD-13063-win-shell-tab-auto-input

fix: win shell tab auto input
This commit is contained in:
Shengliang Guan 2022-10-11 20:53:13 +08:00 committed by GitHub
commit de67ce68a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -1133,6 +1133,10 @@ bool firstMatchCommand(TAOS* con, SShellCmd* cmd) {
// print to screen
printScreen(con, cmd, match);
#ifdef WINDOWS
printf("\r");
shellShowOnScreen(cmd);
#endif
freeCommand(input);
taosMemoryFree(input);
return true;
@ -1195,6 +1199,10 @@ bool nextMatchCommand(TAOS* con, SShellCmd* cmd, SWords* firstMatch) {
// print to screen
printScreen(con, cmd, match);
#ifdef WINDOWS
printf("\r");
shellShowOnScreen(cmd);
#endif
// free
if (input->source) {

View File

@ -417,8 +417,9 @@ char taosGetConsoleChar() {
static char mbStr[5];
static unsigned long bufLen = 0;
static uint16_t bufIndex = 0, mbStrIndex = 0, mbStrLen = 0;
CONSOLE_READCONSOLE_CONTROL inputControl={ sizeof(CONSOLE_READCONSOLE_CONTROL), 0, 1<<TAB_KEY, 0 };
while (bufLen == 0) {
ReadConsoleW(console, buf, SHELL_INPUT_MAX_COMMAND_SIZE, &bufLen, NULL);
ReadConsoleW(console, buf, SHELL_INPUT_MAX_COMMAND_SIZE, &bufLen, &inputControl);
if (bufLen > 0 && buf[0] == 0) bufLen = 0;
bufIndex = 0;
}