Xshell Forum

Disable sending Meta Key sequence after ESC key

Last post: Friday, July 1, 2016 1:29 AM by Support, 3 reply

 
Tuesday, June 28, 2016 4:07 PM - Sylwester

Disable sending Meta Key sequence after ESC key

 
Hi,

Is it possible to disable sending Meta Key after ESC keypress?

I've tried turning on Alt-Key As Meta but it doesn't turn off MetaKey on Esc.

Program Ver. : Xshell 5
Thursday, June 30, 2016 3:05 AM - hardcoder

Re: Disable sending Meta Key sequence after ESC key

 
Hi.
I saw the similar problem at the "viper-mode in emacs" issue.
If you describe details, It would be helpful to solve your problem.
Please comment below.
Thursday, June 30, 2016 6:47 AM - Sylwester

Re: [SOLVED] Disable sending Meta Key sequence after ESC key

 
Thanks for your post!

Problem was that when I hit ESC and quickly afterwards another key it was treated as a combination not as a separate keystrokes.

When I was writing explanation of situation it struck me that the problem may be somewhere deeper than Xshell.

The problem was with tmux+vim combination. I'm so used to tmux that I forgot that it is there and may be interfering.
I've tried vim without tmux and problem wasn't there.

I found out with a bit of googlefu that tmux were treating ESC as meta key (actually meta key is send as esc-sequence) and was waiting for another key to combine it into esc-sequence.

To disable/change this behavior:
set -sg escape-time <value>

Default <value> is 500 ms. Setting it to 0 may cause some problems with different applications, so I've played around and set 40 ms.
set -sg escape-time 40
Friday, July 1, 2016 1:29 AM - Support

Re: Disable sending Meta Key sequence after ESC key

 
Thanks for the detailed explanation. It may prove useful to many vim and tmux users in the future.

Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog