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

Is there a way to save or restore a named session?

Open mail2fish opened this issue 6 years ago • 10 comments

For example, I have two tmux sessions which run in the system. I hope to save and restore them respectively.

mail2fish avatar Jun 26 '18 01:06 mail2fish

We really need this feature, name a saved session and restore a named session. Right now seems resurrect only restore that last saved, or may be we have to trigger resurrect manually against txt file saved in .tmux/resurrect as a workaround.

ghost avatar Aug 28 '18 03:08 ghost

This works for me in Ubuntu 18.10, I have a Personal session and a Work one, I save either one, kill them both and then on restore I've got both of them running again - maybe I'm misunderstanding the issue?

EduardoRT avatar Dec 05 '18 14:12 EduardoRT

#204

aasutossh avatar Mar 01 '19 14:03 aasutossh

Would be nice to have one day.

XVilka avatar Jun 21 '19 07:06 XVilka

The plugin saves your sessions but naming sessions would be outside of the scope of this plugin.

tomosaigon avatar Mar 22 '20 06:03 tomosaigon

Naming sessions in order to allow the user to save and restore multiple different sessions does not seem out of scope to me. It is not uncommon to have multiple sessions open at a given time. I always have a handful open, one for each project I’m involved in (typically around four or five at a time) and always name them after the project. I switch between them throughout the day via [prefix] a -t session-name.

It would be profoundly useful to me to be able to save each session independently or, better yet, to save all of them with a single command using the session name as the identifier.

agarzola avatar Mar 23 '20 12:03 agarzola

Naming sessions would be a tmux feature or tmux plugin that would be separate from tmux-resurrect.

tomosaigon avatar Apr 20 '20 03:04 tomosaigon

I thinking about this to!.. If multiple sessions are open then saving all of them together as one cannot be possible?

annata83 avatar Aug 12 '20 04:08 annata83

Hey guys, I think there's some confusion here about what tmux session is, so let's clarify that. Session is "tmux's session" or a group of tmux windows. All sessions are named. The default naming is just numbers, starting from 0. Create a new session with tmux new-session. Every session can be renamed with prefix + $. You can switch between sessions with eg prefix + s.

tmux-resurrect supports everything related to tmux sessions (since always). Multiple sessions, named sessions etc - we save and restore everything.

What is not supported is saving/restoring single, individual sessions. Example: your tmux runs two sessions "home" and "work". You cannot save/restore just session "work". tmux-resurrect always saves and restores all the sessions at once. It's all or nothing. There are no plans to support saving individual tmux sessions. Reason: it's not needed.

bruno- avatar Aug 12 '20 11:08 bruno-

I'm just going to reference to my plugin from another ticket here:

  • #436

spywhere avatar Apr 28 '22 21:04 spywhere