Problem
When I'm in bash in tmux, I can't use the left arrow key (on my keyboard) to move the cursor left over text I've typed. No other characters show up, the cursor does not move, nothing happens.
Details
If I enter vim, the left arrow works for navigation. So it does not appear to be a general problem within tmux, but only something that shows up on the bash command line. The up and down arrows work in bash in tmux. The left arrow also works normally in bash outside of tmux. When I'm in bash in tmux, hitting Shift Left moves the cursor left instead.
Basic Setup
From PuTTY in Windows I'm ssh'ing to a Fedora 24 box. Then I launch tmux.
Environment
Putty configuration
Terminal -> Keyboard -> keypad: ESC[n~
Terminal -> Features -> nothing checked
Connection -> Data -> term type string: putty-256color
Shell
Outside tmux:
$ echo $0
-bash
$ help
GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu)
Inside tmux:
$ echo $0
-bash
$ help
GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu)
Bash Variables
Outside of tmux:
$ echo $TERM
putty-256color
Inside tmux:
$ echo $TERM
screen-256color
I've also tried setting other values for $TERM
inside tmux, such as screen.putty-256color
which I found with ls -1 /usr/share/terminfo/s/screen*
-- didn't seem to make a difference.
Dump of bash option settings, which are the same inside or outside of tmux:
$ shopt -o
allexport off
braceexpand on
emacs on
errexit off
errtrace off
functrace off
hashall on
histexpand on
history on
ignoreeof on
interactive-comments on
keyword off
monitor on
noclobber off
noexec off
noglob off
nolog off
notify off
nounset off
onecmd off
physical off
pipefail off
posix off
privileged off
verbose off
vi off
xtrace off
I don't have a personal .inputrc, but I see that emacs is on above, and /etc/inputrc has this section:
$if mode=emacs
# for linux console and RH/Debian xterm
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# commented out keymappings for pgup/pgdown to reach begin/end of history
#"\e[5~": beginning-of-history
#"\e[6~": end-of-history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word
# for rxvt
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line
# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
$endif
Notes
I think this was working a week ago. Differences since then I've thought of:
- I had a different PuTTY config (I can try to recover that, it's not easily accessible right now)
- I installed Solarized colors for vim and tried their PuTTY colors too. I took another look at $TERM choices when I did that, but I don't think I made any significant changes that I haven't already undone.
- kernel-headers were updated, glibc was updated.
Troubleshooting
Installing zsh and setting set-option -g default-shell /bin/zsh
in ~/.tmux.conf
did not resolve the issue.
su
'ing to root and starting tmux from root did not resolve the issue.