Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip restore content cleanup to fix fish shell restore #528

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pane_content_files_restore_from_archive() {
local archive_file="$(pane_contents_archive_file)"
if [ -f "$archive_file" ]; then
mkdir -p "$(pane_contents_dir "restore")"
rm "$(pane_contents_dir "restore")"/* # Clean up any existing files
gzip -d < "$archive_file" |
tar xf - -C "$(resurrect_dir)/restore/"
fi
Expand Down
9 changes: 0 additions & 9 deletions scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,6 @@ restore_active_and_alternate_sessions() {
done < $(last_resurrect_file)
}

# A cleanup that happens after 'restore_all_panes' seems to fix fish shell
# users' restore problems.
cleanup_restored_pane_contents() {
if is_restoring_pane_contents; then
rm "$(pane_contents_dir "restore")"/*
fi
}

main() {
if supported_tmux_version_ok && check_saved_session_exists; then
start_spinner "Restoring..." "Tmux restore complete!"
Expand All @@ -378,7 +370,6 @@ main() {
restore_grouped_sessions # also restores active and alt windows for grouped sessions
restore_active_and_alternate_windows
restore_active_and_alternate_sessions
cleanup_restored_pane_contents
execute_hook "post-restore-all"
stop_spinner
display_message "Tmux restore complete!"
Expand Down