@@ -170,12 +170,12 @@ new_pane() {
170170 tmux split-window -t " ${session_name} :${window_number} " -c " $dir "
171171 fi
172172 # minimize window so more panes can fit
173- tmux resize-pane -t " ${session_name} :${window_number} " -U " 999"
173+ tmux resize-pane -t " ${session_name} :${window_number} " -U " 999"
174174}
175175
176176restore_pane () {
177177 local pane=" $1 "
178- while IFS=$d read line_type session_name window_number window_active window_flags pane_index dir pane_active pane_command pane_full_command; do
178+ while IFS=$d read line_type session_name window_number window_active window_flags pane_index pane_title dir pane_active pane_command pane_full_command; do
179179 dir=" $( remove_first_char " $dir " ) "
180180 pane_full_command=" $( remove_first_char " $pane_full_command " ) "
181181 if [ " $session_name " == " 0" ]; then
@@ -200,6 +200,8 @@ restore_pane() {
200200 else
201201 new_session " $session_name " " $window_number " " $dir " " $pane_index "
202202 fi
203+ # set pane title
204+ tmux select-pane -t " $session_name :$window_number .$pane_index " -T " $pane_title "
203205 done < <( echo " $pane " )
204206}
205207
@@ -323,7 +325,7 @@ restore_shell_history() {
323325restore_all_pane_processes () {
324326 if restore_pane_processes_enabled; then
325327 local pane_full_command
326- awk ' BEGIN { FS="\t"; OFS="\t" } /^pane/ && $10 !~ "^:$" { print $2, $3, $6, $7 , $10 ; }' $( last_resurrect_file) |
328+ awk ' BEGIN { FS="\t"; OFS="\t" } /^pane/ && $11 !~ "^:$" { print $2, $3, $6, $8 , $11 ; }' $( last_resurrect_file) |
327329 while IFS=$d read -r session_name window_number pane_index dir pane_full_command; do
328330 dir=" $( remove_first_char " $dir " ) "
329331 pane_full_command=" $( remove_first_char " $pane_full_command " ) "
@@ -333,15 +335,15 @@ restore_all_pane_processes() {
333335}
334336
335337restore_active_pane_for_each_window () {
336- awk ' BEGIN { FS="\t"; OFS="\t" } /^pane/ && $8 == 1 { print $2, $3, $6; }' $( last_resurrect_file) |
338+ awk ' BEGIN { FS="\t"; OFS="\t" } /^pane/ && $9 == 1 { print $2, $3, $6; }' $( last_resurrect_file) |
337339 while IFS=$d read session_name window_number active_pane; do
338340 tmux switch-client -t " ${session_name} :${window_number} "
339341 tmux select-pane -t " $active_pane "
340342 done
341343}
342344
343345restore_zoomed_windows () {
344- awk ' BEGIN { FS="\t"; OFS="\t" } /^pane/ && $5 ~ /Z/ && $8 == 1 { print $2, $3; }' $( last_resurrect_file) |
346+ awk ' BEGIN { FS="\t"; OFS="\t" } /^pane/ && $5 ~ /Z/ && $9 == 1 { print $2, $3; }' $( last_resurrect_file) |
345347 while IFS=$d read session_name window_number; do
346348 tmux resize-pane -t " ${session_name} :${window_number} " -Z
347349 done
0 commit comments