When I SSH in to our server, control + arrow sequences are working fine for me: Ctrl + V then Ctrl + up, down, right, left gives
^[OD respectively. In tmux, I get
I'm connecting to Ubuntu via PuTTY, but…
- I have the correct terminal set (
ncurses-termis installed). All other key combinations are working in the main shell.
- I'm using the right character set (UTF-8).
- I'm definitely getting a 256-colour terminal (I've tried multiple invocations of
I've read the tmux FAQs that say to use this config:
set -g terminal-overrides "xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@"
making my config like so:
set -g default-terminal "screen-256color" set -g terminal-overrides "screen*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@" set-window-option -g xterm-keys on
screenwas recommended elsewhere (though I tried
The only thing I've found that worked is running
tput rmkx within
tmux, but I don't know if that's the correct solution, what other effects it has, if other programs will change this setting, or even how it should be set correctly in
.tmux.conf so that I don't have to type it in manually all the time.
For future readers:
- Don't use
set -g default-terminal "screen-256color"should always be
screen-256colorbecause tmux uses the screen terminal type internally; and
set -g terminal-overrides "putty*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@"should always equal/glob-match
$TERMoutside tmux. By default, PuTTY uses
xtermin Connection > Data > Terminal-type, so either use that in the
terminal-overridessetting, or change PuTTY to use