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.
This commit is contained in:
Ali Ghaffaari 2021-12-19 12:46:07 +01:00
parent 6be2f34b5f
commit c3d0599a6e

View File

@ -270,9 +270,6 @@ restore_all_panes() {
restore_pane "$line" restore_pane "$line"
fi fi
done < $(last_resurrect_file) done < $(last_resurrect_file)
if is_restoring_pane_contents; then
rm "$(pane_contents_dir "restore")"/*
fi
} }
handle_session_0() { handle_session_0() {
@ -375,6 +372,12 @@ restore_active_and_alternate_sessions() {
done < $(last_resurrect_file) done < $(last_resurrect_file)
} }
cleanup_restored_pane_contents() {
if is_restoring_pane_contents; then
rm "$(pane_contents_dir "restore")"/*
fi
}
main() { main() {
if supported_tmux_version_ok && check_saved_session_exists; then if supported_tmux_version_ok && check_saved_session_exists; then
start_spinner "Restoring..." "Tmux restore complete!" start_spinner "Restoring..." "Tmux restore complete!"
@ -394,6 +397,7 @@ main() {
restore_grouped_sessions # also restores active and alt windows for grouped sessions restore_grouped_sessions # also restores active and alt windows for grouped sessions
restore_active_and_alternate_windows restore_active_and_alternate_windows
restore_active_and_alternate_sessions restore_active_and_alternate_sessions
cleanup_restored_pane_contents
execute_hook "post-restore-all" execute_hook "post-restore-all"
stop_spinner stop_spinner
display_message "Tmux restore complete!" display_message "Tmux restore complete!"