aboutsummaryrefslogtreecommitdiffstats
path: root/_tmux.conf
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-02-08 11:16:37 +0800
committerAaron LI <aaronly.me@outlook.com>2017-02-12 17:09:12 +0800
commit316129cf727f3f237d0f8a9898555905ce0df5eb (patch)
tree051f4d0fca32d9ee958dc212577802a897bd46ff /_tmux.conf
parent1e2aa6f8dbeeb59a23908b0b01620ee179c2c5dc (diff)
downloaddotfiles-316129cf727f3f237d0f8a9898555905ce0df5eb.tar.bz2
tmux: Set default terminal to "screen-256color"
Workaround the special key (e.g., Home, End) bindings problem in zsh
Diffstat (limited to '_tmux.conf')
-rw-r--r--_tmux.conf6
1 files changed, 6 insertions, 0 deletions
diff --git a/_tmux.conf b/_tmux.conf
index aa99223..8ac0d59 100644
--- a/_tmux.conf
+++ b/_tmux.conf
@@ -60,11 +60,17 @@ bind-key m set-option -g mouse on \; display "Mouse: ON"
bind-key M set-option -g mouse off \; display "Mouse: OFF"
## Terminal settings
+# "xterm-256color" for tmux has problem with special keys (e.g., Home, End)
+# bindings in zsh.
+# Credit: https://stackoverflow.com/a/18601007/4856091
+set-option -g default-terminal screen-256color
# Override terminal's default Cr (color reset) to avoid the strange
# 'char+112' when just exited the tmux session.
# Credit: https://github.com/tmux/tmux/issues/266
set-option -g terminal-overrides ',xterm*:Cr=\E]12;gray\007'
+set-window-option -g xterm-keys on
+
## Maximize and restore a pane
unbind-key Up
bind-key Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp