我开始使用与 ubuntu 服务器的 putty/ssh 连接为我的手机编译 android,但忘记事先打开“screen ”。它已经运行了几个小时,我需要关闭 Windows 计算机才能 sleep 。有没有办法将 session 移至 screen session ,这样我就不必中断它?或者关闭 Putty session 不会干扰构建吗?
最佳答案
是的!我知道的唯一方法是使用reptyr https://github.com/nelhage/reptyr http://monkeypatch.me/blog/move-a-running-process-to-a-new-screen-shell.html
reptyr - A tool for "re-ptying" programs.
reptyr is 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 a screen, use reptyr to grab it, and then kill the
ssh session and head on home.
USAGE
reptyr PID
"reptyr PID" will grab the process with id PID and attach it to your current terminal.
After attaching, the process will take input from and write output to the new terminal,
including ^C and ^Z. (Unfortunately, if you background it, you will still have to run "bg"
or "fg" in the old terminal. This is likely impossible to fix in a reasonable way without
patching your shell.)
关于terminal - 我可以将事件终端 session 移至 screen session 中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20160300/