On Sun, May 14, 2017 at 01:54:27PM +0200, frantisek holop wrote:
> there seems to be some unexpected behaviour (at least
> for me) in terminal vim running under tmux:
> 
> pressing ESC and right after that the arrow keys to
> move around (vim purist need not comment on this) get
> interpreted as different vim commands: for example UP
> will enter insert mode again, LEFT, RIGHT send some
> deleting commands, DOWN moves the cursor around in
> mysterious ways.
> 
> reproduced this in these environments:
> openbsd -current: urxvt + tmux + vim
> openbsd -current: xterm + tmux + vim
> osx: iterm2 + tmux 2.4 + vim 8.0.596
> 
> could not reproduce this on: openbsd 6.0 release
> 
> leaving tmux always fixes the issue, so i am included
> to think it might be a tmux issue.  any ideas?

tmux has an "escape-time" setting:

    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.

You are probably pressing the arrow keys within this timeframe.  Try
decreasing it to something like 100:

    set-option escape-time 100

This worked for me when I had the same issue.

Regards,
Kusalananda

Reply via email to