Is it possible to have a already started program move to screen/tmux? I'd like to have something like the following:

program;
^Z
screen;
fg;

I know the above won't work, but is there a way to accomplish this?

link|improve this question
It is not a duplicate of that question, as in this one, the user is already running the program and wants to suspend it (^Z), then move to a screen. – Daniel Beck Dec 13 '11 at 8:16
Yes exactly. The program is already running, but then I decide it's better to have it in a screen (so I can leave my PC). I don't care if it creates a new screen session or is added to an existing one … – knittl Dec 13 '11 at 8:20
If it's a non-interactive program, couldn't you just use disown? – Daniel Beck Dec 13 '11 at 8:21
This is a problem of moving a child process under another parent. – karatedog Dec 13 '11 at 9:04
feedback

1 Answer

The problem is under no circumstances simple to solve, but have a look at reptyr. It can sometimes help you, especially if you don't care about noise printed in the original terminal & c. You'll might have to compile it yourself, although some distros, Gentoo for instance, package it.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.