Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you want to get a taste of the benefits of tmux without having to learn anything new, I recommend using iTerm and setting up an alias for

  'ssh [your server] -t "tmux -CC attach || tmux -CC"'
Just running that command will connect to your server and attach to an existing tmux session, or create a new one if needed, and make use of iTerm's tmux integration, so you can use the standard macOS keyboard commands (or the UI) to do things like switch tabs, make new tabs, close them, make new windows, etc. all using tmux and a single ssh connection. You can press 'esc' in the command window to detach from your session and when you return (just using that alias) all your work is just as you left it.


Use mosh[1] instead of ssh for superior handling of weaker connections and roaming. You close your laptop one place, go elsewhere, switch to LTE, whatever, open the lid and you're back on. Don't even need to reconnect.

[1] https://mosh.org/


It's a real shame that it can't handle X11 forwarding, which is pretty much all I use ssh for nowadays.


Well, that and tunnelling all sorts of other traffic, basically mini-VPN. I use this all the time for a variety of remote systems (or local, I am the remote one).


Are there terminal emulators on other platforms that offer similar tmux integration?


'tmux' is actually something that runs server-side if you are ssh'ing into something, it should work with any terminal emulator the same way as GNU screen would if you ever used that, e.g. PuTTY works fine for tmux.


I believe the parent was referring to iTerm's native understanding of tmux windows which is certainly not supported in all terminal emulators.


I never knew about this. Thanks!

When I do this, it opens a new window with the "attached tmux running inside" and the old window is running in "tmux mode". Is it possible to not have a new window open, but use the window where the command is run instead?




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

Search: