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:
commit
de67ce68a5
|
@ -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) {
|
||||||
|
|
||||||
// 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() {
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue