Merge pull request #25120 from taosdata/fix/TD-28554-3.0

windows can not del after press tab
This commit is contained in:
Alex Duan 2024-03-19 09:12:31 +08:00 committed by GitHub
commit 761066ec73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View File

@ -1866,6 +1866,9 @@ _return:
// main key press tab
void pressTabKey(SShellCmd* cmd) {
#ifdef WINDOWS
return ;
#endif
// check empty tab key
if (cmd->commandSize == 0) {
// have multi line tab key
@ -1909,6 +1912,10 @@ void pressTabKey(SShellCmd* cmd) {
// press othr key
void pressOtherKey(char c) {
#ifdef WINDOWS
return ;
#endif
// reset global variant
firstMatchIndex = -1;
lastMatchIndex = -1;

View File

@ -445,7 +445,7 @@ 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 };
CONSOLE_READCONSOLE_CONTROL inputControl={ sizeof(CONSOLE_READCONSOLE_CONTROL), 0, 0, 0 };
while (bufLen == 0) {
ReadConsoleW(console, buf, SHELL_INPUT_MAX_COMMAND_SIZE, &bufLen, &inputControl);
if (bufLen > 0 && buf[0] == 0) bufLen = 0;
@ -500,11 +500,9 @@ int32_t shellReadCommand(char *command) {
}
shellInsertChar(&cmd, utf8_array, count);
pressOtherKey(c);
#ifndef WINDOWS
} else if (c == TAB_KEY) {
// press TAB key
pressTabKey(&cmd);
#endif
} else if (c < '\033') {
pressOtherKey(c);
// Ctrl keys. TODO: Implement ctrl combinations

View File

@ -77,7 +77,7 @@ int shell_conn_ws_server(bool first) {
}
fprintf(stdout, "successfully connected to %s\n", host);
} else {
fprintf(stdout, "successfully connected to cloud service\n");
fprintf(stdout, "successfully connected to service\n");
}
}
fflush(stdout);