Re:Reptyr – Reparent a running program to a new terminal
by justincormack on Sunday December 07, 2014 @01:17PM
(#8713010)
There was some discussion on the NetBSD list today as to how you might do this properly, ie with OS support not some hacks [1]. Although it is not clear it is worth bothering, as you just use screen first...
Re:Reptyr – Reparent a running program to a new terminal
by pmoriarty on Sunday December 07, 2014 @01:20PM
(#8713025)
This is useful for those cases where you didn't start screen first, such as when you either forgot or didn't think you'd need it but it turned out you did.
Re:Reptyr – Reparent a running program to a new terminal
by chrisseaton on Sunday December 07, 2014 @04:24PM
(#8713621)
Doesn't using screen have some drawbacks? For example it breaks native scrolling in the OS X terminal app, so I wouldn't want to run screen unless I really needed it.
Re:Reptyr – Reparent a running program to a new terminal
by anaphor on Sunday December 07, 2014 @04:55PM
(#8713721)
Yeah I don't know. I only mentioned screen to be fair. I use tmux and I don't usually have any problems, although I get problems when I use it with mosh sometimes (particularly weechat mouse support doesn't seem to work well).
Re:Reptyr – Reparent a running program to a new terminal
by caipre on Sunday December 07, 2014 @06:09PM
(#8713991)
screen (and tmux) start a new instance of the shell, which would have no knowledge of the backgrounded process. You'd just see the message "fg: no current job"
Re:Reptyr – Reparent a running program to a new terminal
by emmelaich on Sunday December 07, 2014 @11:12PM
(#8714881)
And even if you could(1), the background process typically has the terminal open - and screen uses a separate pseudo terminal aka pty -- As suggested by the name - rePTYr
(1) ^Z sends SIGSTOP; to continue you can signal SIGCONT. But then what?!
[1] http://blog.gmane.org/gmane.os.netbsd.devel.kernel
* press ctrl-z to put the program in the background
* start screen
* run fg within screen
(1) ^Z sends SIGSTOP; to continue you can signal SIGCONT. But then what?!