Este é exatamente o caso man 1 reptyr menciona explicitamente:
reptyris a utility for taking an existing running program and attaching it to a new terminal. Started a long-running process over ssh, but have to leave and don't want to interrupt it? Just start ascreen, usereptyrto grab it, and then kill the ssh session and head on home.
Não perca esta nota:
reptyrdepends on theptrace(2)system call to attach to the remote program. On Ubuntu Maverick and higher, this ability is disabled by default for security reasons. You can enable it temporarily by doingecho 0 > /proc/sys/kernel/yama/ptrace_scopeas root, or permanently by editing the file
/etc/sysctl.d/10-ptrace.conf, which also contains more information about this setting.
Observe também que reptyr apenas anexa um processo a outro terminal. Isso não significa que o processo se torne um filho do novo shell.
O uso básico é simples:
reptyr PID
onde PID é o PID do processo que você deseja anexar a um novo terminal.