1. Yuya Nishihara
  2. dotfiles

Commits

Yuya Nishihara  committed 052152a

tmux: try separate session for nesting remote tmux

  • Participants
  • Parent commits aae6a35
  • Branches default

Comments (0)

Files changed (2)

File dot.tmux.conf

View file
 bind-key C-z send-prefix
 bind-key z send-prefix
 
-bind-key h command-prompt -p '(ssh)' 'new-window -n %1: "ssh -t %1 tmux -2u attach"'
+# common prefix between normal or nesting session
+if '[ "$(tmux -V | sed "s/[^0-9]//g")" -ge 16 ]' \
+   'set -g prefix2 C-M-z; bind-key C-M-z send-prefix -2'
+
+bind-key h command-prompt -p '(ssh-window)' \
+           'new-window -n %1 "ssh -t %1 tmux -2u attach"'
+bind-key H command-prompt -p '(ssh-session)' \
+           'new-session -s %1 "tmux source ~/.tmux.nesting.conf; ssh -t %1 tmux -2u attach"'
 bind-key / last-window
 
 # allow common typo

File dot.tmux.nesting.conf

View file
+# ~/.tmux.nesting.conf - settings for parent session of nested tmux
+
+# avoid conflict with nested tmux
+set prefix C-M-z
+bind-key C-M-z send-prefix
+
+set status-bg colour18
+set window-status-current-bg colour24