Update tmux config

This commit is contained in:
2017-05-13 14:42:34 +01:00
parent 2e446f1872
commit 8d10d95a1b
3 changed files with 20 additions and 31 deletions

View File

@@ -1,12 +0,0 @@
#! /usr/bin/env bash
# Ensure that tmux windows are by default named after the shell, rather than
# full path to the shell binary.
shell=$(basename "$SHELL")
# If reattach-to-user-namespace is not available, just run the command.
if [ -n "$(command -v reattach-to-user-namespace)" ]; then
reattach-to-user-namespace -l "$shell"
else
exec "$shell"
fi

View File

@@ -1,8 +0,0 @@
#! /usr/bin/env bash
# If reattach-to-user-namespace is not available, just run the command.
if [ -n "$(command -v reattach-to-user-namespace)" ]; then
reattach-to-user-namespace $@
else
exec "$@"
fi

View File

@@ -8,20 +8,29 @@ set -g default-terminal "screen-256color"
set -g detach-on-destroy on
set -g history-limit 50000
# Mouse support
set -g mouse on # Tmux 2.1 and later
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
# Mouse support (pre Tmux 2.1)
if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) < 2.1" | bc)" = 1 ]' \
" \
set -g mode-mouse on; \
set -g mouse-resize-pane on; \
set -g mouse-select-pane on; \
set -g mouse-select-window on; \
"
# Pre Tmux 2.1 mouse scrolling behavior
# - from: https://github.com/tmux/tmux/issues/145#issuecomment-151123624
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Mouse support (Tmux 2.1 and later)
# - scrolling behavior from: https://github.com/tmux/tmux/issues/145#issuecomment-151123624
if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) >= 2.1" | bc)" = 1 ]' \
" \
set -g mouse on; \
bind -n WheelUpPane if-shell -F -t = \"#{mouse_any_flag}\" \"send-keys -M\" \"if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'\"; \
bind -n WheelDownPane select-pane -t= \\; send-keys -M; \
"
# Mac OS X fix for pbcopy, pbpaste, and launchctl
set-option -g default-command "login-shell"
if-shell -b '[ -n "$(command -v reattach-to-user-namespace)" ]' \
" \
set-option -g default-command 'reattach-to-user-namespace -l $SHELL'; \
"
# Set window notifications
setw -g monitor-activity on