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?

2 Answers 2


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".

  • how can I get rid of one of them and reconnect to the other?
    – 719016
    Apr 21, 2013 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, 2013 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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