← Back to context

Comment by cogman10

20 hours ago

I'm by no means a tmux power user, but it does have really nice features for when I need it.

The primary usecase I've had for it is I can kick off 1 or multiple long running jobs, exit, and then come back later and checkout the various stdout logs to see how it worked.

Could I accomplish the same thing with a bunch of stdout pipes, disown, fg, ctrl-z, etc? Sure. However, tmux makes it really easy to do that and then quickly switch around sessions to see how things are going.

In the simplest workflow, it looks like this

    tmux
    longcommand()
    ctrl + B D

and later

    tmux -a

to checkout and see what's gone on with the command long after I disconnected with ssh.

I think it's good practice to always start tmux immediately after opening an SSH connection. You might not know a command is long-running until after you start it. And you never know when you connection will just randomly drop. If you're using tmux it's never a big deal when that happens.

  • I think it's notable that when ubuntu runs an upgrade it starts a tmux session for this reason.