|
1 # Open a floating pane running tmux with a session named floating. If inside |
|
2 # that floating window, detach. |
|
3 bind '~' if-shell -F '#{==:#{session_name},floating}' { |
|
4 detach-client |
|
5 } { |
|
6 set -gF '@last_session_name' '#S' |
|
7 popup -d '#{pane_current_path}' -xC -yC -w70% -h70% -E 'tmux new -A -s floating' |
|
8 } |
|
9 |
|
10 # Normal break pane, but if inside a floating session, breaks pane back into |
|
11 # the most recently opened parent session. |
|
12 bind ! if-shell -F '#{!=:#{session_name},floating}' { |
|
13 break-pane |
|
14 } { |
|
15 run-shell 'bash -c "tmux break-pane -s floating -t \"$(tmux show -gvq '@last_session_name'):\""' |
|
16 } |