Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In both zsh and bash, ctrl+arrows allows me to move the position I'm typing at by whole word, but this does not work in tmux, which is a problem as I'm currently launching it automatically every time I open a shell.

How can I fix this?

share|improve this question
up vote 56 down vote accepted
  1. Edit your ~/.tmux.conf and add lines:
    set-window-option -g xterm-keys on

  2. If you don’t want to make it permanent just yet, do:
    C-b :set-window-option xterm-keys on

  3. Reload your config in tmux by doing:
    C-b :source-file ~/.tmux.conf

More information here:

share|improve this answer
the link is broken – user64115 Jul 18 '12 at 12:56
link worksforme. – Jake Biesinger Sep 24 '13 at 18:32
Strange: This works for me only if I reload the ~/.tmux.conf file from tmux or set the action in the :-prompt of tmux, not initially when I open tmux. Any ideas what might be the problem there? – AME Nov 28 '13 at 18:06
That link appears to be spam. It's talking to me about car insurance. – user535759 Sep 23 '14 at 23:44
Link died, new link: - also updated link in the post – sgzmd Sep 24 '14 at 8:26

set-window-option -g xterm-keys on

Got me some of the way there and gave me ctrl-left/right on the console, but it was still responding differently in vim.

Unbinding the keys didn't seem to help.

It turned out that at some point I had set my default terminal to screen ("set-option -g default-terminal "screen" in .tmux.conf)

Changing this to the following gave me ctrl-left/right in everything else:

set-option -g default-terminal "xterm-256color"

Hope that helps somebody.

share|improve this answer
Except this breaks colors in vim, tig, and presumably a whole bunch of other stuff... – koniiiik Oct 10 '15 at 16:42

I'm not sure, but this might be because tmux by default binds C-<up/down/left/right> to shift the focus onto the pane above/below/left of/right of the currently focused pane. If you don't use panes often, you might not have noticed this feature. If this is what the problem is, you can unbind those keys by saying:

unbind C-Left
unbind C-Right

That might be enough on it's own, or you might need to manually bind them again to what you want them to do, via:

bind -n C-Left <the action you want>
bind -n C-Right <other action you want>
share|improve this answer
It should be enough on it's own, if it isn't grabbed by tmux, it should pass onto the shell. – Rob Dec 14 '11 at 17:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.