How to disable input translation for some keys in GNU Screen


I have Ctrl-Left and Ctrl-Right bound for vim, and would like to be able to use these shortcuts when vim runs inside screen.

However, because of Screen's input translation my key presses are mangled and vim does the wrong thing.

Trying to disable the key bindings with bindkey kr or bindkey -k kr while under screen does not work.

How do I keep my vim shortcuts while running it under screen?

Best Answer

You need to set the $TERM variable to something that supports those keys. By default screen sets it to 'screen'. I have found setting it to 'xterm' does the trick. To achieve this you have two options.

Start screen like this: screen -T xterm, or put the following in your .screenrc.

term    xterm
Related Question