@@ -370,6 +370,31 @@ restore_session_options() {
370
370
done
371
371
}
372
372
373
+ restore_window_options () {
374
+ local has_automatic_rename=" ${d} "
375
+ while IFS=$d read line_type session_name window_index option value; do
376
+ value=$( echo $value | sed ' s/"\(.*\)"/\1/' )
377
+ if [ " $option " == " automatic-rename" ]; then
378
+ has_automatic_rename+=" ${session_name} :${window_index}${d} "
379
+ fi
380
+ tmux set-window-option -t " ${session_name} :${window_index} " " ${option} " " ${value} "
381
+ done <<< $( \g rep ' ^option_window' $( last_resurrect_file) )
382
+
383
+ get_grouped_sessions " $( \g rep ' ^grouped_session\s' $( last_resurrect_file) ) "
384
+ get_linked_windows " $( \g rep ' ^linked_window\s' $( last_resurrect_file) ) "
385
+
386
+ tmux list-windows -a -F " #{session_name}${d} #{window_index}" |
387
+ while IFS=$d read session_name window_index ; do
388
+ if is_session_grouped " $session_name " || is_window_linked " $session_name " " $window_index " ; then
389
+ continue
390
+ fi
391
+
392
+ if [[ " $has_automatic_rename " != * " $session_name :$window_index " * ]]; then
393
+ tmux set-window-option -u -t " $session_name :$window_index " " automatic-rename"
394
+ fi
395
+ done
396
+ }
397
+
373
398
# A cleanup that happens after 'restore_all_panes' seems to fix fish shell
374
399
# users' restore problems.
375
400
cleanup_restored_pane_contents () {
@@ -395,6 +420,7 @@ main() {
395
420
restore_active_and_alternate_windows
396
421
restore_active_and_alternate_sessions
397
422
restore_session_options
423
+ restore_window_options
398
424
cleanup_restored_pane_contents
399
425
execute_hook " post-restore-all"
400
426
stop_spinner
0 commit comments