1

Sometimes I'll start doing something fast. I've got something to do, and I need to get it done now.

Then of course i realize that I need to do something else to help me finish what I started, so I want to add a new shell using tmux (or screen)... but I forgot to start tmux right off....

My question is this:

How can I put a task to the background, start a tmux (or screen) session, and then resume my original task in tmux?

Brad Parks
  • 1,669
  • Not a duplicate since OP already knows about screen and is stating that he started stuff outside of screen that he wants to import into a new (or second) screen session. – bahamat Jun 30 '13 at 06:53
  • @bahamat That's the same scenario as the question I linked to... – jasonwryan Jun 30 '13 at 07:02

1 Answers1

4

I believe you can do what you want using either reptyr ore retty. With either tool you can start up either screen or tmux and pull processes that have been backgrounded/disowned into either. For example:

$ reptyr <pid>

-or-

$ retty <pid>

References

slm
  • 369,824