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
This commit is contained in:
Kurtis Rader 2015-12-22 17:58:38 -08:00
parent f029e04047
commit 814cb51eb5

View file

@ -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;