Как я обожаю диалоги вида:
— как сделать Х?
— если бы ты сделал У, то тебе не нужно было бы делать Х.
Есть reptyr:
Package: reptyr
New: yes
State: not installed
Version: 0.3-2
Priority: optional
Section: misc
Maintainer: Evan Broder <evan@ebroder.net>
Architecture: amd64
Uncompressed Size: 67.6 k
Depends: libc6 (>= 2.4)
Description: Tool for moving running programs between ptys
reptyr is a utility for taking an existing running program and attaching it to a new terminal, and is particularly useful for moving a long-running process into a GNU
screen session.
reptyr does a more thorough job of transferring programs than many other tools, including the popular "screenify" shell script, because it changes the program's
controlling terminal. This means that actions such as window resizes and interrupts are sent to the process from the new terminal.
Homepage: https://github.com/nelhage/reptyr
Он всё сделает.
Но, конечно же, лучше заранее заботится о подобных вещах и в будущем использовать screen.