tmux keeps track of active sessions in a file, on my system this is in /tmp/tmux-1000/default. Recently I manually cleared everything in the /tmp directory, removing this session file.

Normally, you can use tmux attach to reattach to a session. Active sessions can be listed using tmux ls. Because this file is gone, tmux doesn't know about any active sessions:

$ tmux attach
no sessions    
$ tmux ls
error connecting to /tmp/tmux-1000/default (No such file or directory)

Using top I can verify tmux is still running, along with the applications I had opened in that session.

How can I reattach to this session, after I've removed the session file?


The answer was noted in this post.

Sending an SIGUSR1 signal to the tmux process recreases the socket file, allowing you to reattach using tmux attach afterwards.

Since the PID of the running tmux command was 5612, I used:

$ sudo kill -SIGUSR1 5612
$ tmux attach
| improve this answer | |

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