Skip to content

Commit

Permalink
Make shift-arrow keys work in tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Nygard committed Jun 14, 2014
1 parent 0fa3012 commit f2179c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tmux.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Work nicely with emacs key combos
set -g default-terminal "screen-256color"
set -g default-terminal "xterm-256color"
set-window-option -g xterm-keys on

# Bind <C-q> to leader
Expand Down

2 comments on commit f2179c5

@ohpauleez
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up, this is going to mess up the background color of editors (vim/emacs), and potentially affect using ncurses applications that use 256 color.

You may want to avoid setting the default-terminal (or setting it screen-256color), and just dial the in the terminal-overrides for the key combinations you're looking for. You may also want to try this out on iTerm and xterm within Linux (different term encoding sequences). And also confirm that the bash.rc isn't conflicting with the term setting when in Tmux.

An example of the overrides for OS X and iTerm (for shift keys):
setw -g xterm-keys on
set -g terminal-overrides "xterm_:kLFT5=\eO5D,xterm_:kRIT5=\eO5C,xterm_:kUP5=\eO5A,xterm_:kDN5=\eO5B"

@mtnygard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have a known good configuration that works in those cases, please commit it! You'll save us all hours of futzing.

Please sign in to comment.