File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -395,6 +395,14 @@ restore_window_options() {
395
395
done
396
396
}
397
397
398
+ restore_pane_options () {
399
+ \g rep ' ^option_pane' $( last_resurrect_file) |
400
+ while IFS=$d read line_type session_name windows_index pane_index option value; do
401
+ value=$( echo $value | sed ' s/"\(.*\)"/\1/' )
402
+ tmux set-option -p -t " ${session_name} :${windows_index} .${pane_index} " " ${option} " " ${value} "
403
+ done
404
+ }
405
+
398
406
# A cleanup that happens after 'restore_all_panes' seems to fix fish shell
399
407
# users' restore problems.
400
408
cleanup_restored_pane_contents () {
@@ -421,6 +429,7 @@ main() {
421
429
restore_active_and_alternate_sessions
422
430
restore_session_options
423
431
restore_window_options
432
+ restore_pane_options
424
433
cleanup_restored_pane_contents
425
434
execute_hook " post-restore-all"
426
435
stop_spinner
Original file line number Diff line number Diff line change @@ -103,6 +103,18 @@ window_option_format() {
103
103
echo " $format "
104
104
}
105
105
106
+ pane_option_format () {
107
+ local format
108
+ format+=" option_pane"
109
+ format+=" ${delimiter} "
110
+ format+=" #{session_name}"
111
+ format+=" ${delimiter} "
112
+ format+=" #{window_index}"
113
+ format+=" ${delimiter} "
114
+ format+=" #{pane_index}"
115
+ echo " $format "
116
+ }
117
+
106
118
dump_panes_raw () {
107
119
tmux list-panes -a -F " $( pane_format) "
108
120
}
@@ -291,6 +303,20 @@ dump_window_options() {
291
303
done
292
304
}
293
305
306
+ dump_pane_options () {
307
+ tmux list-panes -a -F " $( pane_option_format) " |
308
+ while IFS=$d read line_type session_name window_index pane_index; do
309
+ # not saving panes from grouped sessions
310
+ if is_session_grouped " $session_name " || is_window_linked " $session_name " " $window_index " ; then
311
+ continue
312
+ fi
313
+ tmux show-options -p -t " ${session_name} :${window_index} .${pane_index} " | sed " s/ /$d /" |
314
+ while IFS=$d read option value; do
315
+ echo " ${line_type}${d}${session_name}${d}${window_index}${d}${pane_index}${d}${option} $d ${value} "
316
+ done
317
+ done
318
+ }
319
+
294
320
dump_state () {
295
321
tmux display-message -p " $( state_format) "
296
322
}
@@ -326,6 +352,7 @@ save_all() {
326
352
dump_state >> " $resurrect_file_path "
327
353
dump_session_options >> " $resurrect_file_path "
328
354
dump_window_options >> " $resurrect_file_path "
355
+ dump_pane_options >> " $resurrect_file_path "
329
356
execute_hook " post-save-layout" " $resurrect_file_path "
330
357
if files_differ " $resurrect_file_path " " $last_resurrect_file " ; then
331
358
ln -fs " $( basename " $resurrect_file_path " ) " " $last_resurrect_file "
You can’t perform that action at this time.
0 commit comments