File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,14 @@ restore_active_and_alternate_sessions() {
362
362
done < $( last_resurrect_file)
363
363
}
364
364
365
+ restore_session_options () {
366
+ \g rep ' ^option_session' $( last_resurrect_file) |
367
+ while IFS=$d read line_type session_name option value; do
368
+ value=$( echo $value | sed ' s/"\(.*\)"/\1/' )
369
+ tmux set-option -t " ${session_name} :" " ${option} " " ${value} "
370
+ done
371
+ }
372
+
365
373
# A cleanup that happens after 'restore_all_panes' seems to fix fish shell
366
374
# users' restore problems.
367
375
cleanup_restored_pane_contents () {
@@ -386,6 +394,7 @@ main() {
386
394
restore_grouped_sessions # also restores active and alt windows for grouped sessions
387
395
restore_active_and_alternate_windows
388
396
restore_active_and_alternate_sessions
397
+ restore_session_options
389
398
cleanup_restored_pane_contents
390
399
execute_hook " post-restore-all"
391
400
stop_spinner
Original file line number Diff line number Diff line change @@ -258,6 +258,16 @@ dump_windows() {
258
258
done
259
259
}
260
260
261
+ dump_session_options () {
262
+ tmux list-sessions -F " #{session_name}" |
263
+ while read session_name; do
264
+ tmux show-options -t " ${session_name} :" |
265
+ while read option value; do
266
+ echo " option_session${d}${session_name}${d}${option}${d}${value} "
267
+ done
268
+ done
269
+ }
270
+
261
271
dump_state () {
262
272
tmux display-message -p " $( state_format) "
263
273
}
@@ -291,6 +301,7 @@ save_all() {
291
301
dump_panes >> " $resurrect_file_path "
292
302
dump_windows >> " $resurrect_file_path "
293
303
dump_state >> " $resurrect_file_path "
304
+ dump_session_options >> " $resurrect_file_path "
294
305
execute_hook " post-save-layout" " $resurrect_file_path "
295
306
if files_differ " $resurrect_file_path " " $last_resurrect_file " ; then
296
307
ln -fs " $( basename " $resurrect_file_path " ) " " $last_resurrect_file "
You can’t perform that action at this time.
0 commit comments