lineedit: don't block when looking for escape sequence in vi-mode
authorRon Yorston <rmy@tigress.co.uk>
Fri, 12 Dec 2014 08:29:41 +0000 (08:29 +0000)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 15 Dec 2014 12:30:58 +0000 (13:30 +0100)
In vi-mode lineedit tries to detect some escape sequences.
After the ESC 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.

Signed-off-by: Ron Yorston <rmy@tigress.co.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/lineedit.c

index 3961b1de3d4b94deca71fb4a65d7ad129bffd07f..720a4951e03d7f12deae3ce9751515501a7f44c8 100644 (file)
@@ -2611,7 +2611,7 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
                         * standard readline bindings (IOW: bash) do.
                         * Often, Alt-<key> generates ESC-<key>.
                         */
-                       ic = lineedit_read_key(read_key_buffer, timeout);
+                       ic = lineedit_read_key(read_key_buffer, 50);
                        switch (ic) {
                                //case KEYCODE_LEFT: - bash doesn't do this
                                case 'b':