From e90a22c22ebb2301d4bbf64e7b0128bdef800978 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Sat, 18 Mar 2023 17:10:33 -0300 Subject: [PATCH] Restore tmux on pane-exited hook --- active-row.conf | 1 + restore-tmux | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100755 restore-tmux diff --git a/active-row.conf b/active-row.conf index ac89b0c..c652c09 100644 --- a/active-row.conf +++ b/active-row.conf @@ -70,6 +70,7 @@ bind -n M-F12 run-shell 'tmux -L $TMUX_PARENT source-file ~/.tmux.conf.d/nested- # Handler for closed window: enable outer terminal set-hook -g client-detached "run-shell 'tmux -L $TMUX_PARENT source-file ~/.tmux.conf.d/nested-tmux/active-row.conf && tmux -L $TMUX_PARENT set -g window-status-current-style bg=$active_window_bg'" +set-hook -g pane-exited "run-shell '~/.tmux.conf.d/nested-tmux/restore-tmux'" # # Appearance diff --git a/restore-tmux b/restore-tmux new file mode 100755 index 0000000..eca6e0d --- /dev/null +++ b/restore-tmux @@ -0,0 +1,6 @@ +#!/bin/bash + +TMUX_PARENT=$(basename "$TMUX") +TMUX_PARENT="${TMUX_PARENT%%,*}" + +tmux -L "$TMUX_PARENT" source ~/.tmux.conf.d/nested-tmux/active-row.conf