reddit / emacs

If evil is slow to exit insert mode in tmux

bruchieOP · 2022-10-04 02:56
Something driving me (a bit) crazy when using emacs in a tmux session on a slow remote host. It would take quite a bit of time (we are talking 0.3s but enough to be annoying) to exit the normal mode when inside a tmux session. It would then do some crazy things too between those 0.3s if I start typing some letters... I discovered this [spacemacs issue](https://github.com/syl20bnr/spacemacs/issues/7145) and buried in the comments this tmux setting : set -s escape-time 0 which works exactly as intended and give you an exit to normal mode straight away... so if anyone else has this issue and find this post then I guess you are welcome internet stranger :)
lebensterben · 2022-10-04 03:49
this ultimately results from the problem that most terminals cannot easily differentiate a single press of Esc and the Esc preceding escape codes.... see https://sw.kovidgoyal.net/kitty/keyboard-protocol/ in particular > No reliable way to distinguish single Esc key presses from the start of a escape sequence. Currently, client programs use fragile timing related hacks for this, leading to bugs, for example: neovim #2035.
bruchieOP · 2022-10-04 03:56
great article, thanks! (and i use tmux inside kitty)
lebensterben · 2022-10-04 04:03
I think then it's up to tmux to utilize kitty's new protocol.
[deleted] · 2022-10-04 04:38
[deleted]