From 316129cf727f3f237d0f8a9898555905ce0df5eb Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 8 Feb 2017 11:16:37 +0800 Subject: tmux: Set default terminal to "screen-256color" Workaround the special key (e.g., Home, End) bindings problem in zsh --- _tmux.conf | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.2