Oh shoot! I started this process outside of tmux, but now I need to go away and it's been running a while, what can I do?
[Ctrl-z] on the process
bg
echo $! # get the PID (1608)
disown
tmux
reptyr 1608
@climagic
reptyr is really nice.
@climagic
do es this work with screen?
@bigMouthCommie @climagic Yes, reptyr’s README literally mentions screen as a use case https://github.com/nelhage/reptyr/blob/master/README.md
reptyr/README.md at master · nelhage/reptyr

Reparent a running program to a new terminal. Contribute to nelhage/reptyr development by creating an account on GitHub.

GitHub
@climagic This is now on an alias called `tmuxify`. Thank you!
@climagic does this works also in screen ? reptyr is not a tmux command ? In general these commands are not installed ?
@ixo @climagic It is an entirely separate executable: https://github.com/nelhage/reptyr
GitHub - nelhage/reptyr: Reparent a running program to a new terminal

Reparent a running program to a new terminal. Contribute to nelhage/reptyr development by creating an account on GitHub.

GitHub
@climagic I tried this recently, but the target pid had subprocesses and I just couldn’t get it to reptyr.
@climagic Boosted, fav'd and bookmarked, so there is a tiny little chance I can find it again when I need it in the future. 😆
#term_tips #tmux
@climagic well explain too that they need to activate it in kernel space to can do. echo 0 > /proc/sys/kernel/yama/ptrace_scope as root or edit the file ..... otherwise that don't work. and for some strange reason it only work with a new tmux instance
(like you do) . in a open one don't let me attach. error in pid tell me.
@climagic this is a delight advanced topic of command line use!
@climagic One thing to be aware of: It sometimes only works once for a process. I tend to grab it while in screen/tmux for that reason.
@climagic this is one of the small things that will save you so much time if you need it. A 6 TB restore nearly failed because I forgot to plug in my laptop. Before I got dc'd from the server, I reptyr ed the process into a screen