Skip restore content cleanup to fix fish shell restore #528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #526
When using fish shell, it seems all windows except the first one for each session will error when restoring pane contents. The error is something along the lines of
cat: '/home/monarch/.local/share/tmux/resurrect/restore/pane_contents//pane-0:1.0': No such file or directory
(from #526).My best guess is that fish lazily runs commands or something and each window after the first in tmux doesn't trigger this until opened later.
Either way, instead of cleaning up the pane content files after we've attempted the restore, I leave the files around until the next restore, where I delete them just before we untar the saved contents. This way, the files hang around long enough for the panes to restore them (lazily?), but we still make sure they're reset before the next restore (cleaning up any extra files from the previous restore that may not be in the new one).