I'm using gVim 9.0 on Windows. Here is the steps to reproduce the issue:
- Open a vim-terminal with
- Open a vim inside the vim-terminal using command
- Enter insert mode and type something more than 5 chars (such as
- Return normal mode with Esc, and move cursor to column 3 (position of
- Press i to enter insert mode.
- Press Esc to exit insert mode. <-- issue appears
The Esc in step 4 is totally fine, but when I type Esc in the last step, in about 1 second it won't exit insert mode but acts like I'm pressing Alt. For example, it will print a
á if I type Esc and then a, as if I pressed Alt + a. And this vim-terminal is like corrupted: I have to exit the vim-terminal and start another fresh one with
:term to make this issue stop.
I've tried to
set ttimeout and
set ttimeoutlen=1, but it doesn't help.
Is there anyway to resolve this issue?
ttimeoutlensetting (note the two
ts)? The way Alt keymappings work is that the terminal sends
<Esc>followed by the key (so
<Esc>x); Vim will wait
ttimeoutlenmilliseconds for the second key (if this value is -1, the value of
timeoutlenis used, which defaults to 1000, or 1 second). Usually you can set
ttimeoutlento something fairly short like
50; the only value for long timeouts is slow SSH connections and the like.
ttimeout=-1. I’ve tried to set ttimeout to 1, and set ttimeout as well as set ttimeout=1, both in gVim and in the vim inside gvim-terminal, but no avail. However, I’ve found a workaround: use
[for Esc, hehe.
[works exactly the same with
Esc: ( I found more details about this issue and updated question. Could you review it and see if there is any new idea, if it's not inconvenient for you?