shell: fix shell history error
This commit is contained in:
parent
65f33f194e
commit
4247cac970
|
@ -524,10 +524,8 @@ int32_t shellReadCommand(char *command) {
|
||||||
c = taosGetConsoleChar();
|
c = taosGetConsoleChar();
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'A': // Up arrow
|
case 'A': // Up arrow
|
||||||
if (hist_counter != pHistory->hstart) {
|
|
||||||
hist_counter = (hist_counter + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE;
|
hist_counter = (hist_counter + SHELL_MAX_HISTORY_SIZE - 1) % SHELL_MAX_HISTORY_SIZE;
|
||||||
shellResetCommand(&cmd, (pHistory->hist[hist_counter] == NULL) ? "" : pHistory->hist[hist_counter]);
|
shellResetCommand(&cmd, (pHistory->hist[hist_counter] == NULL) ? "" : pHistory->hist[hist_counter]);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'B': // Down arrow
|
case 'B': // Down arrow
|
||||||
if (hist_counter != pHistory->hend) {
|
if (hist_counter != pHistory->hend) {
|
||||||
|
|
Loading…
Reference in New Issue