Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I don't know if this is supposed to work by default, but it seems like when I try to resume a tmux session I have from one machine or a different one. I am using two different kinds of connection to the tmux session, one from a Cygwin terminal versus another from an Ubuntu VM on the same computer. The sessions that are brought up are two different sessions. If I delete all windows in a session and disconnect from it, a brand new one is created instead of connecting to the existing one in the other method of connection. In both cases I connect via ssh to the same server, then run the tmux command below. I usually resume my session with this command:

tmux a -d || tmux

EDIT: I am disconnecting either with Ctrl+a Ctrl+d or simply by a disconnection in the network itself, but I can recover the connection afterwards if I do it with the same system I came from originally. If I list my session from Cygwin I get:

 tmux ls
0: 1 windows (created Wed Apr 17 15:49:23 2013) [149x45]

If I list it with the VM I get something different:

 tmux ls
0: 19 windows (created Thu Apr 11 09:24:00 2013) [191x35]

Any parameter I am missing?

share|improve this question

2 Answers 2

up vote 2 down vote accepted
+25

This looks like a problem with sockets -- I suspect at some point you've created a brand new tmux listening on a different socket to your original one (perhaps perturbed via your shell when you've logged in?) and now have two tmux servers running.

Check /tmp (if this is where the tmux server creates its sockets) and you should be able to determine this, as well as the output from "ps aux".

share|improve this answer
    
how can I get rid of one of them and reconnect to the other? –  130490868091234 Apr 21 '13 at 15:09
    
You can't -- I mean, you should work out why the location of the socket creation changes, but see -S and -L to tmux to connect to a specific instance. Are you saying then that you do have more than one socket created? –  ThomasAdam Apr 21 '13 at 15:12

You're not killing your to much session every time are you? CTRL-A CTRL-D to detach from the session, rather than kill it.

When you are connected, list your tmux sessions with a tmux ls. Make note of the first number from this command, that is what you will wan't to connect back to. Then to connect to that session from either machine us a tmux attach -t 0 assuming your tmux session is 0.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.