make tmux recognise ssh sessions

This commit is contained in:
eneller
2022-09-08 08:50:59 +02:00
parent de389f9e46
commit 8eaa3653a3
3 changed files with 40 additions and 2 deletions

View File

@@ -1,6 +1,13 @@
tmux_config_dir="~/.config/tmux"
mod="C-a"
#CONFIGURATION
set-option -g prefix C-a # rebind tmux prefix to CTRL + a because vim uses default CTRL + b
bind-key C-a last-window # double-press of CTRL + a (tmux prefix) switches to previous window
#if-shell '[[ -n "$SSH_CLIENT"]]' {
# source-file $tmux_config_dir/tmux_remote.conf # use alternative config for tmux inside ssh session
# mod="C-b"
#}
set-option -g prefix $mod # rebind tmux prefix to CTRL + a because vim uses default CTRL + b
bind-key $mod last-window # double-press of CTRL + a (tmux prefix) switches to previous window
set-window-option -g mode-keys vi # vi mode
set-option -g allow-rename off # dont rename windows on command execution TODO fix
set -s escape-time 0 # dont delay escape key in vim
@@ -19,3 +26,4 @@ set -g status-left ""
set -g status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}#{=21:pane_title}"
set -g status-style fg=white,bg=black # color for the statusbar
set-window-option -g window-status-current-style fg=black,bg=blue # color for the current window (tab)