I was hoping there was a hidden ssh parameter or something similar
Well, ask yourself, how should this work?
Processes start with three standard streams connected to the controlling terminal (if not redirected somehow):
stdin
,
stdout
and
stderr
.
Of course, you
can launch a process "in the background", and you can add redirections so it isn't confused when one of the streams is suddenly closed, and even more, you can insert a parent process like
nohup
that will "eat" the
HUP
signal when you disconnect from your shell, so the process doesn't terminate in response to it.
But there
can't be any way to reconnect the I/O streams to a different terminal (of your next login) without a parent process that keeps running and manages that.
I didn't know about
dtach
, it's obviously the most light-weight solution to offer this, without even keeping a buffer of the terminal contents. But really, if you need to re-attach a process,
tmux
is the perfect tool for that