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

Restoring and Multiple Servers

Open SamuelLarkin opened this issue 4 years ago • 4 comments

Hi, I have a use case where I need two tmux servers. I would start the second server by tmux -L CentOs7 new -s myjob. The issue I'm having is that the second server tries to restore the first server's session which is NOT what I want. Is there a way to have multiple servers with their separate save/restore?

SamuelLarkin avatar Oct 23 '20 14:10 SamuelLarkin

Hi, this plugin does not have the awareness of socket name (CentOs7 in tmux -L CentOs7). When you perform restore it just restores the last saved session from any tmux server.

bruno- avatar Oct 24 '20 10:10 bruno-

hi, I am also interested in this feature!

digging around, it looks like modifying resurrect_file_path to append the socket path (tmux display-message -p -F "#{socket_path}") could bring us 80% of the way there

is this the right direction?

I suppose you'd also need multple last links, one for each socket ?

samm81 avatar May 09 '21 06:05 samm81

@samm81 I’m not sure multiple last links are required—if we simply use current socket as part of resurrect_dir (filename may be enough, since all sockets are in the same directory: basename $(tmux display-message -p -F "#{socket_path}")), that should cover everything? I might try it.

strogonoff avatar Jul 07 '23 03:07 strogonoff

Done in https://github.com/tmux-plugins/tmux-resurrect/pull/481, seems to work according to local testing on my machine.

strogonoff avatar Jul 07 '23 03:07 strogonoff