Closed rajeshisnepali closed 4 years ago
This is working for me. I am on the current HEAD.
Before you save via resurrect, verify tmux sees two or more sessions using leader + s.
Examine ~/.tmux/resurrect/last. Does the file list sessions? At the bottom, there is a "state" line that for me, lists my two sessions.
state macbook webinar
Are you creating sessions using sockets? tmux -S /tmp/shared new -s {sessionName}
Here's my ~/.tmux/resurrect/last output
Unfortunately, it is not listing my "general" session. And do you know if resurrect saves any session automatically (without prefix+s
)?
Are you creating sessions using sockets? tmux -S /tmp/shared new -s {sessionName}
No, I normally create the session using tmux new -s {session_name}
Well, afraid I am of little help. This is working for me. It is also working on several other OSs for me.
I tried this too and it is working for me as well. Is it possible to list out the commands you run step by step so we can try to follow and see what is missing?
My ~/.tmux.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other examples:
set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
I had 2 sessions.
I went to one of those sessions (probably the second one). I then hit prefix+Ctrl+S
. After reboot, I opened a new tmux session simply by executing tmux
, and then I hit prefix+Ctrl+R
to get my sessions back.
I did only get the session in which I had pressed the command.
Please let me know if you need additional information.
Can you perform following steps:
prefix + W
, and screenshot the output.prefix+Ctrl+S
tmux kill-server
.tmux
.prefix+Ctrl+R
prefix + W
, and screenshot the output.Step No. 2
Step No. 7
@jiaming10 I'd also like to add few things. I rarely shut-down my laptop (once a week). The last time I saved & restored the tmux session worked fine. I think this issue arose before 2 shutdowns.
I think this should work fine. Perhaps, back then will be some kind of glitch. I'll be shutting down my laptop tonight. So I will give you the output tomorrow.
@jiaming10 I think it works fine now.
How do I clear my existing saved tmux sessions? Will removing ~/.tmux/resurrect/last
or manually deleting sessions & then saving only one session work?
I think the best way to do is manually create/delete sessions,windows,pane, until a state that you prefer. Then you save it.
By saving each time, ~/.tmux/resurrect/last
's content will backup to another file before it gets overwritten, you can verify this in ~/.tmux/resurrect
folder. This will help you if you wanted to go back to a saved state previously, in case you have a change of mind.
I had two sessions having 2 windows in each. Before the shutdown, I pressed
prefix+Ctrl+S
to save my sessions.After reboot, Pressing
prefix+Ctrl+R
only restored the session in which I saved the session. Does it not save all the sessions?