tmux-plugins / tmux-resurrect

Persists tmux environment across system restarts.
MIT License
11.14k stars 418 forks source link

Possibility to save different sessions #181

Open FiloSpaTeam opened 7 years ago

FiloSpaTeam commented 7 years ago

Hi, i think it can be useful bind "save with name" or bind Ctrl + s + 1, for example, to save session-1 and handle last-1. Usually i work with i3 and a "desktop" with tmux opened and i restore all my windows (in tmux):

  1. rails session with all about my project
  2. screenfetch and bash standard
  3. mutt and khal and khard (like agenda)

It's very powerfull but it can be more if i can detach sessions and load when i want. I hope i'm clear.

Thanks

IT'S A VERY GOOD PLUGIN ;)

bruno- commented 7 years ago

Hi, request noted.

Frankly, I never fully understood the need for this feature: why fiddle with individual sessions when you can save all and just forget about it. But this was requested in a couple issues already and should be acknowledged.

FiloSpaTeam commented 7 years ago

Hi :+1:

I have 4 windows in my tmux session. 1 is full of things that i don't need when i work on sources, i need only when i want to "play" with the system and something else. There are commands that are autorun with tmux resurrection like rails server and other so it's preferable to select which session to open, to avoid what i don't need in that moment :)

If i have time i'll try to implement myself and create a pull request, but at the moment i'm working on another free (as in freedom) software :)

2E0PGS commented 6 years ago

+1 for this. I don't want to have to load them all up just to use one. I may have some for special use cases such as debugging a certain program or whatever.

chingologram commented 6 years ago

+1. For example, I have two sessions where I save ssh connections to 5 servers each (5 for tmux sessoin "Staging", 5 for tmux session "Prod"). However, I wouldn't want to have ~10 open ssh connections as soon as I login. Instead, it would be helpful to spawn a session as needed. E.g.: I need to run some commands on Staging, I resurrect the "staging" session with its 5 windows, each with a different ssh connection. Once I finish, then I kill the tmux session with all the ssh connections. I continue work on my other sessions: vim, local machine, etc. If I need the connections again, I resurrect only the Staging or Prod session, etc.

PaddiM8 commented 5 years ago

I want this too! It would be really need to be able to store a session file for each project, which restores just that session.

gtozzi0 commented 5 years ago

+1 This would be a great feature to have.

toransahu commented 4 years ago

+1 This would be a great feature to have.

losnappas commented 4 years ago

Hey,

Is there something other than the files in ~/.tmux/resurrect/ that are needed for the resurrections? Here's what I'm thinking.

To restore:

  1. Start tmux.
  2. Run new resurrect script with <prefix><c-r>name, or probably use a script to list & pick.
  3. Script symlinks @last to the session you wanted.
  4. Restores session normally.

To save:

  1. <prefix><c-s>name to save, or use current name if exists(?).
  2. Saves session as it would
  3. Script renames saved session to name.
  4. Quits session. Nevermind, no need to do that.

Edit: whoops, didn't mean to @ anyone there.

spywhere commented 2 years ago

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