提交 9c458b68 编写于 作者: wafwerar's avatar wafwerar

fix: win shell tab auto input

上级 c8fd6b74
...@@ -1133,6 +1133,10 @@ bool firstMatchCommand(TAOS* con, SShellCmd* cmd) { ...@@ -1133,6 +1133,10 @@ bool firstMatchCommand(TAOS* con, SShellCmd* cmd) {
// print to screen // print to screen
printScreen(con, cmd, match); printScreen(con, cmd, match);
#ifdef WINDOWS
printf("\r");
shellShowOnScreen(cmd);
#endif
freeCommand(input); freeCommand(input);
taosMemoryFree(input); taosMemoryFree(input);
return true; return true;
...@@ -1195,6 +1199,10 @@ bool nextMatchCommand(TAOS* con, SShellCmd* cmd, SWords* firstMatch) { ...@@ -1195,6 +1199,10 @@ bool nextMatchCommand(TAOS* con, SShellCmd* cmd, SWords* firstMatch) {
// print to screen // print to screen
printScreen(con, cmd, match); printScreen(con, cmd, match);
#ifdef WINDOWS
printf("\r");
shellShowOnScreen(cmd);
#endif
// free // free
if (input->source) { if (input->source) {
......
...@@ -417,8 +417,9 @@ char taosGetConsoleChar() { ...@@ -417,8 +417,9 @@ char taosGetConsoleChar() {
static char mbStr[5]; static char mbStr[5];
static unsigned long bufLen = 0; static unsigned long bufLen = 0;
static uint16_t bufIndex = 0, mbStrIndex = 0, mbStrLen = 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) { 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; if (bufLen > 0 && buf[0] == 0) bufLen = 0;
bufIndex = 0; bufIndex = 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册