From 814cb51eb5dafac779324cf8a9ce4c7894b3af9a Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Tue, 22 Dec 2015 17:58:38 -0800 Subject: [PATCH] improve handling of the escape character Increase the delay between seeing an escape character and giving up on whether additional characters that match a key binding are seen. I'm setting the value to 500 ms to match the readline library. We don't need such a large window for sequences transmitted by a terminal (even over ssh where network delays can be a problem). However, we can't expect humans to reliably press the escape key followed by another key with an inter-char delay of less than ~250 ms based on my testing and research. A value of 500 ms provides a nice experience even for people using "fish_vi_mode" bindings as a half second to switch from insert to normal mode is still fast enough that most people won't even notice. Resolves #1356 --- src/input_common.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/input_common.cpp b/src/input_common.cpp index 24fde6e2d..cda4ca11e 100644 --- a/src/input_common.cpp +++ b/src/input_common.cpp @@ -32,8 +32,10 @@ Implementation file for the low level input library Time in milliseconds to wait for another byte to be available for reading after \\x1b is read before assuming that escape key was pressed, and not an escape sequence. + + This is the value used by the readline library. */ -#define WAIT_ON_ESCAPE 10 +#define WAIT_ON_ESCAPE 500 /** Characters that have been read and returned by the sequence matching code */ static std::deque lookahead_list;