Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
How to run tmate on an already existing tmux session #26
Before proposing paid offerings, which will most likely be used for production environment, I need to do a bit of work. I need to restructure the whole server-side, to allow reconnections, and fault tolerance (if one of my server dies). The new pipeline will also allow incorporation of websockets (for the HTML5 stuff), and session recording (probably to Cassandra, with fulltext search done with Elasticsearch).
Thanks for the support :)
You can nest tmux & tmate sessions as much as you like as long as you first set
So inside an existing tmux/tmate session, you can run new ones like this:
You can also access pre-existing tmux sessions on the machine you're accessing using tmate by using:
You'll need to be careful though because the tmux prefix will always be captured by the outer tmux/tmate session, and you'll need to press it twice to have tmux forward it one level deeper. This means you'll need to press it
Basically, when you press Ctrl-B once, you'll be sending commands to the outermost session, pressing it twice will send commands to the one inside it, and to access a session inside that one, you'll need to press it 4 times.
Having to press Ctrl-B Ctrl-B Ctrl-B Ctrl-B Ctrl-N to move between windows is either totally crazy or totally awesome.
However, if you manage your tmux sessions properly you will never need more than 2 levels (ie. max depth = 1).
One way to do this would be to:
I have a few words of advice though:
This works for me, and it works pretty well actually. But I cannot guarantee that it will not blow up in your face, so be careful.
Until attach/detach work with tmate I recommend nesting tmux as mentioned by @maljub01. To deal with the nested command key I suggest setting tmate to something other than what is used by tmux. I can recommend using ctrl-] which is telnet's escape sequence.
Basically treat tmate as a sharing container for whatever work you are doing and not for any of it's tmux capabilities.
referenced this issue
Mar 20, 2018
Hello, I just implemented a solution but it is quite different. I set up my
Now I installed
First, it checks if a
It will open a new
I needed to unset the
added a commit
Dec 7, 2018
The solution is simple, nest TMUX inside TMate. Unfortunately the information above on how to do this seem rather complicated. Here is my take to add to the confusion and maybe it will help someone.
First understand your TMUX prefix key. By default this is CTRL-B In the following examples I have choosen to use CTRL-Space by use of this command in my
Next in your
Lastly, when I launch I do so in two steps. Since I live in TMUX normally I typically will detach and reattach inside tmate when I need. Alternatively I could also launch a new session inside tmate if I wish. The trick is when inside tmate to always prefix my TMUX commands with
$ tmate ------------------- Inside tmate --------------------- $ TMUX= tmux attach