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
add or merge Tmux control mode support #79
Comments
This looks really good. Hopefully the user who owns the fork will craft a proper pull request against this repo. If not, we'll still look at it, but I personally don't use tmux that much, so any guidance you could give would help. What are people looking for from tmux integration? |
Looking further. Wow, that's a lot of work they've done. Hopefully they'd be willing to work with us, as that terminator code is probably missing all the python3 fixes. |
TLDR: I'm sure there are more features that a more advanced user might know about. But personally, I'm looking for the following:
As an intermediate level tmux user, I think I can best provide an insight by describing my use of tmux. Because I administrate multiple systems remotely, I find myself more often than not logging into the remote server and then running tmux inside terminator, because otherwise I'd have to ssh many times (every time I opened a tab). Opening tmux inside the remote server, saves me time and headache associated with constantly connecting. But it also allows me to save my sessions remotely and reconnect to them the next day, or between laptop reboots. Sometimes, even though I have no work to do on the remote server, I actually open a tmux session on the remote server, just because I want to continue where I left off the next day. I know that there are some plugins that allow you to save terminator sessions. But so far I haven't found one that accurately saves the buffer of all active windows/tabs and the window/tab configurations. Additionally, I appreciate the fact that the tmux status bar allows you to dynamically and contextually display any text you want. It is the closest I've seen to a "task bar" that you typically find on desktop systems and it adds just enough extra benefit, that I can permanently live in my terminal in full screen. For example, you can place small scripts that will add a kubernetes or git context indicator for your current folder, hostname, cpu info, memory usage, clock etc (instead of shoving it on to the end of my already overloaded bash prompt!). Lastly, even when my entire desktop crashes, my tmux session may survive. So my shell work flow can exist independent of my gui. e.g. If my desktop crashes then just move to a Linux tty and attach to the tmux session I was using in terminator! |
Thanks. This was very instructive and it really does sound like something good to have, and according to https://unix.stackexchange.com/questions/189805/what-terminal-emulators-support-tmux-control-mode it's not widely available. I hope the authors of that fork get in touch, because that would be much quicker than me trying to integrate their code. |
I hope so as well. As I mentioned, I opened an issue in the author's repo. So I hope they will be in touch soon :) Also, I forgot to mention one of the most interesting features in tmux, which is the ability to share sessions between multiple clients. This means that one user can start a session and multiple people can connect to it remotely (through ssh) or locally and optionally control the session (in the same window, or even a separate window). Basically desktop-sharing for terminals! I'd love to see this feature supported in Terminator as well through the Tmux control mode :) |
I contacted the original author of the fork via email, and he said he's going to try and rebase his changes on the new codebase :) |
Oh good. I definitely want more/better tmux integration, but I don't use it enough to know what is important or give it a thorough test. |
I had to squash all the commits from Dan and Andrea, who did most of the tmux work back in 2016. Sadly I just wasn't able to preserve the commit history when merging. I created #378, but it is not working. However all the code is there and it only hangs when started in tmux mode. Maybe someone with more knowledge of terminator (and/or tmux control mode) can fix this easily? |
oh gods yes i'm so hyped for this, might take a look at the code in a bit and see if i can get it working |
I've been working on an MR for this, but the original code might be a bit too outdated to get working properly. I started a rewrite of the implementation, but haven't had much time to work on it recently. |
oh great ! thanks |
is your rewrite of the implementation posted anywhere ? i'm not sure what would be best for me to work on atm |
My first attempt to merge it is here, but it's currently broken: #408 I've been working on a new version, but I have to say I'm very disheartened by it all. In an ideal world the feature should be bidirectional, i.e. any changes made within tmux should be reflected in real time in Terminator and vice versa, but it's turning out to be really difficult to do. You can really tell that Terminator wasn't built with something like this in mind. As an example, when a new pane (a One option is to translate all the possible changes to an actual operation: if we recognize that a tmux pane was split, for example, we can run a split command on the corresponding Terminator pane. That's also not trivial: there's no real way to traverse the tree of translated layout children and tie them to actual widgets, so we'd have to populate a global mapping as the layout is being created. Then the new terminal would need to know that it's a tmux terminal, but the only current way to pass that information is through the layout and the Another option could be to destroy and recreate the window with the new layout? Long story short: this is a big, big mess and it would take a huge amount of work to get it working, a lot more than I originally expected. The original implementation got away with a bunch of stuff because it never accounted for changes made on the tmux side of things, but I feel like having that is kind of a must? Or rather, the actual limitation is that you would only be able to either run the session via tmux or via Terminator, but never both at the same time. Let me know your thoughts. As it is, I'm probably gonna drop it since I don't really have enough time to invest in this 😞 |
(This is still doable, at least in a limited way, if we decide to completely drop the bidirectional sync and have Terminator drive most of the logic -- it just means that things might get messed up if people use tmux in the background to modify the shared session while Terminator is running) |
In classic programmer fashion, I think I had an epiphany overnight 😆 I'm testing a couple things and it might actually be doable -- if not I can always fall back on the one at a time approach. |
Thanks again for all your work on this. I wish I could do more than offer encouragement and support, but I've never used tmux or even screen really, so I have no idea what's necessary. If you have any questions or need anything from me, please don't hesitate to ask. I'm usually around on https://gitter.im/gnome-terminator/community |
No worries! I was a bit frustrated because I really wanted to get bidirectional sync working, and I think I finally nailed it. Slowly adding the rest of the functionality in. Here's a sneak peek :) tmux1.mp4 |
Just FYI I didn't die -- life got in the way and my free time suddenly went to almost zero. I'm hoping to pick this up again soon! |
No problem, I figured it was something like that, and wasn't worried. Thanks again and I appreciate everything you've done so far. |
@iamjackg If you're willing to throw your code up (even in WIP state) it'd be helpful. If I have some time in the near future to work on this, this is definitely high up on my priority list. Every time I try to copy-paste in tmux I am reminded of why I want this so badly! And for anybody looking at this in the future, this terminal emulator also seems to support tmux CC mode. I haven't used it yet though, so I can't say if it's actually good or not: https://eternalterminal.dev/ |
Yeah, it looks like I won't be able to spend much time on this for a while. Sorry :( I pushed all my changes here: https://github.com/iamjackg/terminator/tree/tmux-v2 It's very much in a WIP state, i.e. a huge mess. To get started with it, I suggest you diff it with the current main branch and start following the flow from here: https://github.com/iamjackg/terminator/blob/tmux-v2/terminator#L133 Good luck! If you have any questions post them here, and I'll try to answer when I have a moment :) |
I wanted to chime in as someone who uses tmux constantly but only in a very basic way (for the tabs+scrollback history). @iamjackg, based on your assessment above, would it be far easier to get something basic working with:
? |
I also have one tool: works with open-ssh (as a proxyCommand), so can't survive after ssh client gone |
I think it's fine (and greatly simplifies the problem):
|
(Feature request)
Tmux control mode would allow users to connect terminator to a tmux session and represent the tmux session with the Terminator GUI.
As I understand this feature has already implemented at https://github.com/manno/terminator .
I added an issue to that repo as well. So maybe the author will respond and look into merging his code into this main repo.
But if for some reason he is not able to do so, I want to at least raise awareness that the feature seems to exist for those who are interested.
The text was updated successfully, but these errors were encountered: