mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
fix(console): bug where backspace erases the prompt in dumb mode
This commit is contained in:
@ -1122,9 +1122,15 @@ static int linenoiseDumb(char* buf, size_t buflen, const char* prompt) {
|
||||
if (count > 0) {
|
||||
buf[count - 1] = 0;
|
||||
count--;
|
||||
}
|
||||
|
||||
/* Only erase symbol echoed from stdin. */
|
||||
fputs("\x08 ", stdout); /* Windows CMD: erase symbol under cursor */
|
||||
flushWrite();
|
||||
} else {
|
||||
/* Consume backspace if the command line is empty to avoid erasing the prompt */
|
||||
continue;
|
||||
}
|
||||
|
||||
} else {
|
||||
buf[count] = c;
|
||||
++count;
|
||||
|
Reference in New Issue
Block a user