terminal - 我可以将事件终端 session 移至 screen session 中吗?

标签 terminal gnu-screen

我开始使用与 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/

相关文章:

git - 如何使用私有(private)分支或存储库公开我的点文件?

image - 如何在终端中查找特定大小的图像?

linux - 相当于 Linux 的 "screen"

linux - 如果存在 git 命令,则使 bash 命令回退到 git 命令

macos - 使用 MacOS 终端从 .tar.xz 存档中提取具有文件扩展名的特定文件

linux - 如何判断我是否在 screen 中?

php - 使用phpseclib通过SSH在SSH screen 上运行命令

unix - 如何在 screen session 中控制 screen session ?

linux - 可以阅读 linux gnu-screen 的最后一行吗?

linux - linux 或 mac 终端命令可以向上滚动而不是向下滚动吗?