mirror of
https://github.com/tmux-plugins/tmux-resurrect.git
synced 2025-09-10 21:23:09 +00:00
Preserving layout of zoomed windows across restores
The problem is that tmux list-window shows only the current pane layout if a pane is maximized. This is a bug in tmux. In order to avoid this bug we unzoom the window when saving and zoom in again after saving. This implies that the Z flag is no longer set in list-windows, and so it can't be used when restoring. Instead we use the Z flag of the panes (which still have it) to restore the zoom.
This commit is contained in:

committed by
Bruno Sutic

parent
3ba092459a
commit
ad52ade4bf
@ -73,3 +73,10 @@ resurrect_history_file() {
|
||||
local pane_id="$1"
|
||||
echo "$(resurrect_dir)/bash_history-${pane_id}"
|
||||
}
|
||||
|
||||
restore_zoomed_windows() {
|
||||
awk 'BEGIN { FS="\t"; OFS="\t" } /^pane/ && $6 ~ /Z/ && $9 == 1 { print $2, $3; }' $(last_resurrect_file) |
|
||||
while IFS=$'\t' read session_name window_number; do
|
||||
tmux resize-pane -t "${session_name}:${window_number}" -Z
|
||||
done
|
||||
}
|
||||
|
Reference in New Issue
Block a user