tmux-continuum icon indicating copy to clipboard operation
tmux-continuum copied to clipboard

Tmux resurrect file not found!

Open janzenz opened this issue 8 years ago • 16 comments

I get this error when running tmux.

Running on OSX Sierra 10.12.2 Tmux 2.3

Here is my tmux.conf file:

# TMUX Ressurect plugin
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

set -g @continuum-save-interval '5'
set -g @continuum-restore 'on'

run '~/.tmux/plugins/tpm/tpm'

janzenz avatar Jan 11 '17 01:01 janzenz

The resurrect directory did exist but looks like it was caused by the lack of saved session in the directory. This had me confused for the entire time and thought I installed the plugin incorrectly so after further reinstalls I finally got it. For newbs like me I think it would probably help if the error would be more specific.

janzenz avatar Jan 11 '17 06:01 janzenz

I had same error, after trying to save session. chmod 755 ~/.tmux fixed it. Problem was that it was never saving the session because of permission issues.

omenius avatar Jan 27 '17 08:01 omenius

Yeah.... and this is obvious, but make sure you've actually saved a session (prefix + ctrl-s) before trying to restore (prefix + ctrl-r). :man_facepalming:

jimafisk avatar Jun 19 '17 15:06 jimafisk

I had a same issue. Resolved the issue by

  1. ls -lah ~/.tmux/tmux-resurrect/last
  2. cd ~/ && ls -lah .

if your tmux folder is owned by "root", not username like this drwxr-xr-x 3 root root 4.0K Jul 21 17:33 .tmux/ Make sure to change the ownership by sudo chown $(whoami):$(whoami) -R .tmux

My stupidity of using root privilege whilst installing resurrect caused this issue....

forkjoseph avatar Jul 26 '17 03:07 forkjoseph

This error occurred for me when the symbolic link last was pointing to a non-existent resurrect file. I'm guessing I quit tmux while tmux-resurrect was saving.

To solve I created a new link pointing to the last created save:

ln -sf tmux_resurrect_2017-09-08T09:53:43.txt last

tim-phillips avatar Sep 08 '17 17:09 tim-phillips

If you try to save it from a vagrant machine into the host via shared folder it wont work because of the permissions as @omenius said :'/

nicanordlc avatar Jan 16 '18 03:01 nicanordlc

UPDATE 20180627: To follow up with what user errors were causing my issue... I regularly transition between a VM and laptop, which means I'm always pushing and pulling changes from my repos. In the case of tmux-resurrect, I tried simplifying my dotfile management by using $ git add -u, which as I know now, will NOT bring in any newly created files, only update those that were already part of the repo. This caused the last file to point to a .txt file reference that, after pulling down from git, did not exist in the pull. Going back to manually adding things through $ git add .tmux-resurrect and things are now smooth sailing again :)

Thank you @tim-phillips, your solution is what did the trick on my end!

Blake-LeBlanc avatar Jun 26 '18 14:06 Blake-LeBlanc

This happened to me just after restarting my computer using the "reboot" command line. I suppose it somehow caught the resurrect plugin in the middle of saving the session and it never got the chance to create the "last" symbolic link before the shutdown. Thank you @tim-phillips for the tip.

ghost avatar Nov 05 '18 17:11 ghost

I wrote a shell function to help dealing with this:

function tmux-resurrect-reset-last() {
    cd ~/.tmux/resurrect && \
        ln -f -s $(/bin/ls -t tmux_resurrect_*.txt | head -n 1) last && \
        /bin/ls -l last
}

reorx avatar Nov 22 '19 05:11 reorx

This issue no longer happens on latest updates.

ghost avatar Nov 26 '19 12:11 ghost

Still happening for me, latest version. I regularly come to this issue and try a couple of the solutions but never manage to find out which one actually does the trick.

dreamflasher avatar Jun 17 '21 11:06 dreamflasher

Yeah.... and this is obvious, but make sure you've actually saved a session (prefix + ctrl-s) before trying to restore (prefix + ctrl-r). man_facepalming

These is the solution!

Bogdan-Torkhov avatar Jan 31 '23 16:01 Bogdan-Torkhov

Happened to me on a Mac today after rebooting. After a lot testing, I finally decided to change the following in my ~/.tmux.conf.local file

  • From
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-dir '$HOME/.tmux_resurrect'

To hardcoding the path

set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-dir '/Users/myuserid/.tmux_resurrect'

No idea why using $HOME stopped working as I didn't change anything and I've used that in resurrect-dir for years. I use $HOME since I clone my dotfiles across many Linux and Mac systems, and the home directory / userid vary depending on the system.

flakrat avatar Apr 18 '24 00:04 flakrat

No idea why using $HOME stopped working as I didn't change anything and I've used that in resurrect-dir for years. I use $HOME since I clone my dotfiles across many Linux and Mac systems, and the home directory / userid vary depending on the system.

Had the same problem. Tried to use ~ instead of $HOME, successfully.

ivanp7 avatar Apr 29 '24 12:04 ivanp7