mtm icon indicating copy to clipboard operation
mtm copied to clipboard

Allow setting the escape key delay

Open mspielberg opened this issue 3 years ago • 1 comments

By default ncurses waits a full second after the escape key is pressed before returning it from wget_wch(), to see if the remainder of an escape sequence is present. This is quite painful when using programs inside mtm that use the escape key often (e.g. modal text editors like vim).

This PR exposes this delay as part of config.h.

tmux exposes this as the escape-time setting, while screen exposes this as maptimeout.

I have selected 500 ms as a default to match tmux, although in practice for local usage a setting of 5 ms or less is appropriate.

mspielberg avatar May 05 '22 22:05 mspielberg

You can set the desirable value in the environment variable ESCDELAY, before calling mtm, achieving the same result without changing the source code. Nonetheless, a more sensible default value would be nice. Here I use 100 ms.

leorosa avatar May 05 '22 22:05 leorosa

Thank you!

deadpixi avatar Aug 22 '22 03:08 deadpixi