aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2014-12-13 15:51:16 +0000
committerRon Yorston <rmy@pobox.com>2014-12-13 16:02:34 +0000
commit912600054c309718b25eca13f9d10825ac707f80 (patch)
tree0006c9ab93c83f5c61a835551fb294eea2e6eecd
parentf8077fbe6831018338dae29077a21d4b06ba7e85 (diff)
downloadbusybox-w32-912600054c309718b25eca13f9d10825ac707f80.tar.gz
busybox-w32-912600054c309718b25eca13f9d10825ac707f80.tar.bz2
busybox-w32-912600054c309718b25eca13f9d10825ac707f80.zip
lineedit: don't block when looking for escape sequence in vi-mode
When in vi-mode lineedit tries to detect some escape sequences. After an escape it reads the next character to check for certain values. This read should have a timeout or a user-entered ESC to switch to command mode doesn't properly handle the next character.
-rw-r--r--libbb/lineedit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 71dd12a61..1f5653cb5 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -2668,7 +2668,7 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
2668 * standard readline bindings (IOW: bash) do. 2668 * standard readline bindings (IOW: bash) do.
2669 * Often, Alt-<key> generates ESC-<key>. 2669 * Often, Alt-<key> generates ESC-<key>.
2670 */ 2670 */
2671 ic = lineedit_read_key(read_key_buffer, timeout); 2671 ic = lineedit_read_key(read_key_buffer, 20);
2672 switch (ic) { 2672 switch (ic) {
2673 //case KEYCODE_LEFT: - bash doesn't do this 2673 //case KEYCODE_LEFT: - bash doesn't do this
2674 case 'b': 2674 case 'b':