Merge pull request #25120 from taosdata/fix/TD-28554-3.0
windows can not del after press tab
This commit is contained in:
commit
761066ec73
|
@ -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;
|
||||
|
|
|
@ -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,13 +500,11 @@ 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);
|
||||
pressOtherKey(c);
|
||||
// Ctrl keys. TODO: Implement ctrl combinations
|
||||
switch (c) {
|
||||
case 0:
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue