20

I'm looking at tmux from screen, and have hit a bump while configuring the (highly configurable!) tmux key bindings.

Problem is, in my .screenrc I have

bindkey ^[[d prev
bindkey ^[[c next
bindkey ^[[a title
bindkey ^[[b screen 1

and the bindings work (they originally came from rxvt-tabbedex).

But in tmux there's apparently no way to bind commands to ShiftLeft/Right combinations. Please prove me wrong.

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
Leonid Shevtsov
  • 345
  • 1
  • 2
  • 7

2 Answers2

14

Try this (as a partial example):

bind -n S-Right next-window
bind -n S-Left previous-window

That should be enough to make it easy to get the other 2 settings working too. It works on my tmux installation (1.4) but YMMV.

You can also use the meta key (option on Macs, alt on PCs):

bind-key -n M-Right next-window
bind-key -n M-Left previous-window 

If you're using Terminal.app in OS X you need to enable the use of the option key in the Preferences for that to work. (As far as I remember it works by default in iTerm, but if not it can definitely be enabled.)

iconoclast
  • 9,057
  • 12
  • 56
  • 95
1

I don't know if you were in my situation (windows desktop using putty on linux server) but I have the same problem.

I solve this issue using MobaXterm instead of putty and using "classic bind-keys":

bind-key -n C-right next
bind-key -n C-left prev
GouNiNi
  • 11
  • 1