Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge windows from multiple session files into a single session #10

Open
pghalliday opened this issue Jan 16, 2015 · 6 comments
Open

Merge windows from multiple session files into a single session #10

pghalliday opened this issue Jan 16, 2015 · 6 comments

Comments

@pghalliday
Copy link
Contributor

Definitely a feature request and as this issues section is so clean I feel bad about raising it here. But here goes anyway :)

I have been configuring different sessions for different scenarios and often find myself adding the same windows in multiple sessions. Also I sometimes run multiple sessions when working on more than one thing. However starting multiple sessions (starting new terminals!) and switching sessions is a bit clumsy. So I have a potential solution to both these problems.

It would be nice if when I run tmuxomatic from inside a session it just added the windows from the session file to the current session. I imagine it would make sense if it only added windows that did not already exist (keyed by name).

To be honest I'm new to tmux and tmuxomatic (which I think is awesome, thanks!) and I may eventually figure out how this can be done. But if you can think of a quick way to do this that would be cool :)

As a bonus feature it might be cool if you could start tmuxomatic with multiple session files and it similarly merged the window lists :)

As the final icing on the cake perhaps an include directive could be added so that session files could include other session files with similar merged results.

I had some other ideas about namespacing window names instead of ignoring duplicates but that may be overkill for now and can be implemented in my session files if i want.

@oxidane
Copy link
Owner

oxidane commented May 15, 2015

Thanks. It's always good to hear that others appreciate tmuxomatic.

So you want to combine windows from multiple session files. You listed three possible implementations:

  1. Live addition of session windows
  2. Multiple sessions at command line
  3. Include directive in session file

Yes on 1.

No native support for 2 and 3. Adding these would complicate Flex and the planned session synchronization features. However, once 1 has been implemented, it will be easy to make a wrapper script to support the other two.

I'll add the feature in the next couple of versions. I'll leave this issue open until it's added.

@oxidane
Copy link
Owner

oxidane commented Jul 8, 2015

Added in 2.19.

When tmuxomatic is run within tmux, it now adds windows to the current session. Any windows that already exist by name will be skipped.

As for the other two features you mentioned, you could make a simple wrapper script to accomplish both.

  1. Multiple sessions at command line:
  • Create <temporary_session_file>
  • Concatenate contents of each <session> file into it
  • Run tmuxomatic <temporary_session_file>
  1. Include directive in session file:
  • As each <session> is copied into the <temporary_session_file>
  • Recursively replace each include directive with its referenced file
  • Skip any windows that have already been included

I'm leaving this issue open until 2.19 has been released to PyPI.

Thanks again for your feedback and contributions!

@pghalliday
Copy link
Contributor Author

Thanks!

@bmatcuk
Copy link

bmatcuk commented Jul 14, 2015

Any ETA on the 2.19 release? I'm really looking forward to this feature, too =)

@oxidane
Copy link
Owner

oxidane commented Jul 21, 2015

It's probably going to be a few weeks before it's released. For now you'll have to git clone the development copy; check out the readme for installation instructions. It's stable, and I've been using the new feature quite a bit, so you should have no problem with it.

@bmatcuk
Copy link

bmatcuk commented Jul 21, 2015

Ok, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants