Skip to content

Commit c3d0599

Browse files
committed
Fix #141
The issue apprently happens when using fish as the default shell. This commit fixes this issue by postponing `restore/pane_contents` clean-up after calling `restore_active_pane_for_each_window` (scripts/restore.sh:392). It might also fix #192.
1 parent 6be2f34 commit c3d0599

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/restore.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,6 @@ restore_all_panes() {
270270
restore_pane "$line"
271271
fi
272272
done < $(last_resurrect_file)
273-
if is_restoring_pane_contents; then
274-
rm "$(pane_contents_dir "restore")"/*
275-
fi
276273
}
277274

278275
handle_session_0() {
@@ -375,6 +372,12 @@ restore_active_and_alternate_sessions() {
375372
done < $(last_resurrect_file)
376373
}
377374

375+
cleanup_restored_pane_contents() {
376+
if is_restoring_pane_contents; then
377+
rm "$(pane_contents_dir "restore")"/*
378+
fi
379+
}
380+
378381
main() {
379382
if supported_tmux_version_ok && check_saved_session_exists; then
380383
start_spinner "Restoring..." "Tmux restore complete!"
@@ -394,6 +397,7 @@ main() {
394397
restore_grouped_sessions # also restores active and alt windows for grouped sessions
395398
restore_active_and_alternate_windows
396399
restore_active_and_alternate_sessions
400+
cleanup_restored_pane_contents
397401
execute_hook "post-restore-all"
398402
stop_spinner
399403
display_message "Tmux restore complete!"

0 commit comments

Comments
 (0)