DEV Community

Discussion on: How to keep a process running even after closing SSH connection?

 
pklapperich profile image
pklapperich • Edited

Screen does use sockets, but AFAIK there's not an option to "attach to this socket". With tmux it's just 'tmux -S /path/to/socket'. I've found this very useful for sharing a terminal while doing remote support with family/friends. I had done this via screen previously and it was significantly more effort (and involved screen's internal permissions system: wiki.networksecuritytoolkit.org/in...)

Compare the "easy 6 step" process described on the screen wiki with the following in tmux:
$ tmux -S /tmp/shared_socket # start the session using the named socket file
$ chmod 777 /tmp/shared_socket # grant any user on the system access to the socket
$ # that's it. Now the other user can use tmux -S /tmp/shared_socket to connect with full read/write access. Want to give only read access? then give them permission 6 instead of 7. Want to limit to less than all users? Then use chown, setfacl, etc.


Both can be configured extensively and launched/controlled via scripts. Both can be set as default on a tty. I find the tmux config file to be a lot easier/straight forward.


How exactly are you defining "more stable and mature"?


While I think tmux is easier to use (the config file structure and default key bindings make more sense to me), the #1 selling point for me with tmux is that if I split the screen 6 ways and detach, when I re-connect (from any device), the screen is still split 6 ways. With screen all 6 windows are still running, but I have to re-arrange them into a 6-way split again.