Consequences of ‘escape-time 0’ tmux setting

keyboardterminaltmux

I find that when running (neo)vim inside tmux, the escape-key is delayed. This is fixed by putting

set -sg escape-time 0

in my .tmux.conf. Presumably, this disables the possibility of using ESC as the "meta" key. Assuming that I always work with keyboards that have an Alt key to act as "meta", I'm wondering what potentially undesirable consequences that setting might entail.

Best Answer

Setting escape-time to zero interferes with tmux recognizing function-keys. Its manual page says

escape-time time
Set the time in milliseconds for which tmux waits after an escape is input to determine if it is part of a function or meta key sequences. The default is 500 milliseconds.

The term "function key" applies to anything that has that format (including pageup, used in scrolling by tmux, and cursor-keys). 500 milliseconds may be excessive if you never work remotely. 20 milliseconds is workable for local connections. The analogous ESCDELAY in ncurses defaults to 1000 milliseconds; only a very small fraction of users find it necessary to change that.

Related Question