2013-11-23 28 views
7

Tôi bắt đầu biên dịch android cho điện thoại bằng kết nối putty/ssh với máy chủ ubuntu của mình, nhưng quên mở "màn hình" trước khi quay tay. Nó đã được chạy trong một vài giờ và tôi cần phải tắt máy tính cửa sổ của tôi để ngủ. Có cách nào để chuyển phiên sang phiên màn hình, vì vậy tôi không phải làm gián đoạn nó? Hoặc sẽ đóng phiên putty không can thiệp vào việc xây dựng?Tôi có thể chuyển phiên làm việc đầu cuối đang hoạt động sang phiên màn hình không?

Trả lời

4

có! cách duy nhất tôi biết là sử dụng 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.) 
+0

Cảm ơn bạn rất nhiều! Điều này sẽ cứu tôi đau đầu trong tương lai. –

Các vấn đề liên quan