News for hackers. Stuff that matters.
Re:How to move a running process into a tmux session (2020) by kennu on Tuesday October 04, 2022 @06:11PM (#33087782)
It's a nice tool (reptyr), but not particularly convenient to use, requiring several steps to move the process to the background and remembering the PID etc. I do wish this was a more streamlined, standard feature of Unix/Linux shells. Something like a simple integrated "pushproc"/"popproc" command.
Re:How to move a running process into a tmux session (2020) by CGamesPlay on Wednesday October 05, 2022 @01:16AM (#33091555)
Seems not super hard to do. A shell function could do the bg, disown, and use the tmux remote API to start a new window and remotely execute reptyr in it.
Re:How to move a running process into a tmux session (2020) by jcynix on Wednesday October 05, 2022 @06:56AM (#33093770)
The streamlined version is what "screen -d …" does, so it's some kind of standard feature, isnt it?. The only "drawback" I see is that you have to plan ahead to use screen.

When I start long running jobs, I try do start them that way, so I can check on them (and their output in a screen logfile) from anywhere:

screen -L -Logfile "batch-xyzzy-221005a" -S "xyzzy1" bash job.sh

Now I can just check the log with grep or less, or reattach to it if some action is needed.

Re:How to move a running process into a tmux session (2020) by kennu on Wednesday October 05, 2022 @07:27AM (#33093979)
I also use tmux beforehand, when I plan ahead. But I think this discussion is about those situations where you didn't plan ahead and still need to somehow keep a process running.
Re:How to move a running process into a tmux session (2020) by kleiba on Wednesday October 05, 2022 @01:52AM (#33091780)
"Do one thing and do it well."
Re:How to move a running process into a tmux session (2020) by mananaysiempre on Wednesday October 05, 2022 @12:34PM (#33097705)
Judging from the amount of infrastructure that’s been built around background text-mode processes, job control does half a thing and sucks at it. It’s still mandatory, so I wouldn’t blame people for wanting to streamline the process of disassociating from that half-baked builtin support and substituting it with a replacement mechanism.