aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/input_common.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2015-12-22 17:58:38 -0800
committerGravatar Kurtis Rader <krader@skepticism.us>2015-12-22 17:58:38 -0800
commit814cb51eb5dafac779324cf8a9ce4c7894b3af9a (patch)
tree34c6af1975e92d0c3c8793cc0660a5e42fa6f6a4 /src/input_common.cpp
parentf029e040473089f46bcb1b8bbafc3be11f97825d (diff)
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
Diffstat (limited to 'src/input_common.cpp')
-rw-r--r--src/input_common.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/input_common.cpp b/src/input_common.cpp
index 24fde6e2..cda4ca11 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<wint_t> lookahead_list;