Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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