tmux-plugins / tmux-continuum

Continuous saving of tmux environment. Automatic restore when tmux is started. Automatic tmux start when computer is turned on.
MIT License
3.31k stars 149 forks source link

Tmux resurrect file not found! #33

Open janzenz opened 7 years ago

janzenz commented 7 years ago

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 commented 7 years ago

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.

omenius commented 7 years ago

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.

jimafisk commented 7 years ago

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:

forkjoseph commented 7 years ago

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....

tim-phillips commented 7 years ago

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

nicanordlc commented 6 years ago

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 :'/

Blake-LeBlanc commented 6 years ago

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!

ghost commented 6 years ago

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.

reorx commented 5 years ago

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
}
ghost commented 4 years ago

This issue no longer happens on latest updates.

dreamflasher commented 3 years ago

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.

Bogdan-Torkhov commented 1 year ago

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!

flakrat commented 7 months ago

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

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.

ivanp7 commented 6 months ago

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.

m4c0 commented 2 days ago

This one is horrid for troubleshooting. I’m not sure why the report is in this repo because the error message is in tmux-continuum.

The error is triggered by a [ -f … ] criteria. If you know shell, you know that error can mean a lot of stuff - including missing directory, etc.

In my case it was misspelling of resurrect - not fun when English is not your first language… 😐