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.26k stars 150 forks source link

Save file is not created after timeout #136

Closed f0s3 closed 1 month ago

f0s3 commented 7 months ago

The issue:

I can do leader + ctrl+s and leader + ctrl+r, works as it should by creating a file and restoring from it.

I expect that every n minutes (i have set my interval to 2 minutes for easier testing) it will create a new file in the resurrect dir.

When I close terminal and open it everything is perfect, as it should be. However, if I restart my PC, it loads last manually saved session, e.g. last save file that exists.

I haven't found out yet what files it uses for restoring if i just close the terminal and open it up again. But the save files are not updated at all unless I save them.

Note that I have a bit of a complex setup, but everything should work anyway.

My setup is: i'm running arch + i3wm, I use alacritty for the terminal emulator, inside of it I use oh-my-zsh with tmux in the plugins section of ~/.zshrc and I have ZSH_TMUX_AUTOSTART=true there as well, so that when I open my terminal, tmux is launched right away. I also moved my .tmux.conf file to the ~/.config/tmux/tmux.conf and updated it to use new paths.

You can see my tmux config here

Probably relevant lines are those:

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
set -g @continuum-save-interval '2'
set -g @resurrect-dir '/home/f0s3/.config/tmux/resurrect'

Do you have any ideas or maybe what to look for?

darricheng commented 6 months ago

When you close the terminal, is the tmux server killed as well? If you close and reopen the terminal, it could be that tmux is still running in the background. You can check if anything is saved by resurrect by checking if anything is saved to the resurrect save dir.

I'm also trying to figure out why continuum isn't automatically saving my session data as per the save-interval.

f0s3 commented 5 months ago

@darricheng You mean this?

[f0s3@nitro5 pleso-front-v3]$ tmux list-sessions
personal: 1 windows (created Tue Apr  9 11:22:35 2024)
work: 4 windows (created Tue Apr  9 11:22:36 2024)

(I opened bash in my vscode, closed terminal and run tmux list-sessions in bash terminal)

darricheng commented 5 months ago

@f0s3 Sorry, I can't recall what was going through my mind when I typed the previous comment. My fix was as per the known issues section of the readme. Otherwise, I'm afraid I'm not sure how else to help right now.