12

Is there a way to move windows between different screen sessions?

For example lets say I have this scenario:

screen -S screen1
vim *.cpp
C-a d
screen -S screen2

Is there any way to move my shell containing my vim session from screen1 to screen2?

2

1 Answer 1

5

You can use injcode to move a process between ttys. To move process with PID run in target screen window:

$ injcode -m retty PID

However when you close the parent Screen session, moved processes will also terminate.

Edit: I was wrong, it works. Everything is described here. Suppose you want to move "htop" and only one instance is running:

$ injcode -m retty $(pgrep htop)
$ pkill -SIGSTOP htop
$ pkill -SIGCONT htop

then on the previous shell type:

$ disown
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .