Hacker News new | past | comments | ask | show | jobs | submit login

> but its fundamental value add to any programmer who has to SSH into servers more than once a week is it allows you to split your screen up into multiple independent shells without needing a graphical environment at all.

I actually think that value add for SSH is that people is the ability to allow long-running jobs to survive a disconnection. It can be frustrating doing something that takes multiple hours (like a large wget download) just to have your connection break about ten minutes before it's done. Even if you never use any of the other features you immediately benefit from that.




It just fits my mental model much better.

It's close to a "remote desktop" where you connect to an existing "screen" and continue where you left off, vs each time you connect, a brand new "screen" being created, and it getting destroyed as soon as you disconnect. The fact that the shell dies as soon as you disconnect is far more problematic than just long running jobs.


Exactly. One of my favorite things about working in tmux is that my editor session persists, whatever state my laptop is in. Out of battery? Rebooted after updating the kernel? My workspace stays the same


Yeah, I agree with that. I use tmux for pretty much everything, and I do use the splits and multiple screens when I do. In fact I do use it even when I'm working locally because I like the keyboard shortcuts and mouse support (and why I've never really cared if my text editor has a terminal built in).


Doesn’t ^z and bg solve this?


No, it doesn't. There's no way to reattach to a process which was backgrounded and detached in another terminal -- once the parent terminal is gone, the process is stuck in the background. Most interactive processes will terminate immediately when this happens.


Yep, if you remember to do that. What's nice about tmux is that this happens automatically. It requires zero additional mental forethought outside of typing tmux exactly once, and then all your jobs are safe, and you can still see them in the foreground.


You'd also need to disown it if you want it to persist sessions

If you just bg it, it will still die when your session disconnects


generally you can not bring processes to the foreground once you left the session. there are hacky ways to do it though:

http://github.com/nelhage/reptyr

http://github.com/jerome-pouiller/reredirect

https://github.com/lkundrak/retty/


Not really - often what I’m doing is running something with a conditional breakpoint which will only be hit a long way into process lifetime (potentially nondeterministically), so I really do need “a session which will persist indefinitely including across SSH sessions”.


SIGHUP




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: