How to remotely detach a screen from another terminal
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
So I have 2 terminals open in front of me;
- /dev/pts/1 - 'the controller'
- /dev/pts/2 - 'the receiver'
I am currently using ttyecho to execute commands in /pts2 from /pts1.
I can list the screens - ttyecho -n /dev/pts/2 screen -ls
fine from /pts1 and see the results in /pts2.
I can attach to a screen ttyecho -n /dev/pts/2 screen -x [blah]
from /pts1 on /pts2 fine.. But what I can't do, is when attached to a screen then detach from it.
So if /dev/pts/2 is then inside a screen, I am trying to detach from it by executing a command using ttyecho from /dev/pts1
I've tried sending...
ttyecho -n /dev/pts/2 ^a+d
ttyecho -n /dev/pts/2 screen -d -r
ttyecho -n /dev/pts/2 screen -D -RR
ttyecho -n /dev/pts/2 screen -d -r
ttyecho -n /dev/pts/2 screen -DRi
ttyecho -n /dev/pts/2 Ctrl+a+d
ttyecho -n /dev/pts/2 Ctrl+a d
ttyecho -n /dev/pts/2 CTRL + A
ttyecho -n /dev/pts/2 control+a
So I guess what I need is either:
- A command I can send that will detach the screen OR
- Someway to send some kind of pseudo keyboard commands via
ttyecho
to that other screen to detach it.
Any help most appreciated.
command-line terminal gnu-screen tty
add a comment |Â
up vote
2
down vote
favorite
So I have 2 terminals open in front of me;
- /dev/pts/1 - 'the controller'
- /dev/pts/2 - 'the receiver'
I am currently using ttyecho to execute commands in /pts2 from /pts1.
I can list the screens - ttyecho -n /dev/pts/2 screen -ls
fine from /pts1 and see the results in /pts2.
I can attach to a screen ttyecho -n /dev/pts/2 screen -x [blah]
from /pts1 on /pts2 fine.. But what I can't do, is when attached to a screen then detach from it.
So if /dev/pts/2 is then inside a screen, I am trying to detach from it by executing a command using ttyecho from /dev/pts1
I've tried sending...
ttyecho -n /dev/pts/2 ^a+d
ttyecho -n /dev/pts/2 screen -d -r
ttyecho -n /dev/pts/2 screen -D -RR
ttyecho -n /dev/pts/2 screen -d -r
ttyecho -n /dev/pts/2 screen -DRi
ttyecho -n /dev/pts/2 Ctrl+a+d
ttyecho -n /dev/pts/2 Ctrl+a d
ttyecho -n /dev/pts/2 CTRL + A
ttyecho -n /dev/pts/2 control+a
So I guess what I need is either:
- A command I can send that will detach the screen OR
- Someway to send some kind of pseudo keyboard commands via
ttyecho
to that other screen to detach it.
Any help most appreciated.
command-line terminal gnu-screen tty
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
So I have 2 terminals open in front of me;
- /dev/pts/1 - 'the controller'
- /dev/pts/2 - 'the receiver'
I am currently using ttyecho to execute commands in /pts2 from /pts1.
I can list the screens - ttyecho -n /dev/pts/2 screen -ls
fine from /pts1 and see the results in /pts2.
I can attach to a screen ttyecho -n /dev/pts/2 screen -x [blah]
from /pts1 on /pts2 fine.. But what I can't do, is when attached to a screen then detach from it.
So if /dev/pts/2 is then inside a screen, I am trying to detach from it by executing a command using ttyecho from /dev/pts1
I've tried sending...
ttyecho -n /dev/pts/2 ^a+d
ttyecho -n /dev/pts/2 screen -d -r
ttyecho -n /dev/pts/2 screen -D -RR
ttyecho -n /dev/pts/2 screen -d -r
ttyecho -n /dev/pts/2 screen -DRi
ttyecho -n /dev/pts/2 Ctrl+a+d
ttyecho -n /dev/pts/2 Ctrl+a d
ttyecho -n /dev/pts/2 CTRL + A
ttyecho -n /dev/pts/2 control+a
So I guess what I need is either:
- A command I can send that will detach the screen OR
- Someway to send some kind of pseudo keyboard commands via
ttyecho
to that other screen to detach it.
Any help most appreciated.
command-line terminal gnu-screen tty
So I have 2 terminals open in front of me;
- /dev/pts/1 - 'the controller'
- /dev/pts/2 - 'the receiver'
I am currently using ttyecho to execute commands in /pts2 from /pts1.
I can list the screens - ttyecho -n /dev/pts/2 screen -ls
fine from /pts1 and see the results in /pts2.
I can attach to a screen ttyecho -n /dev/pts/2 screen -x [blah]
from /pts1 on /pts2 fine.. But what I can't do, is when attached to a screen then detach from it.
So if /dev/pts/2 is then inside a screen, I am trying to detach from it by executing a command using ttyecho from /dev/pts1
I've tried sending...
ttyecho -n /dev/pts/2 ^a+d
ttyecho -n /dev/pts/2 screen -d -r
ttyecho -n /dev/pts/2 screen -D -RR
ttyecho -n /dev/pts/2 screen -d -r
ttyecho -n /dev/pts/2 screen -DRi
ttyecho -n /dev/pts/2 Ctrl+a+d
ttyecho -n /dev/pts/2 Ctrl+a d
ttyecho -n /dev/pts/2 CTRL + A
ttyecho -n /dev/pts/2 control+a
So I guess what I need is either:
- A command I can send that will detach the screen OR
- Someway to send some kind of pseudo keyboard commands via
ttyecho
to that other screen to detach it.
Any help most appreciated.
command-line terminal gnu-screen tty
edited Feb 9 at 14:49
Jeff Schaller
31.3k846105
31.3k846105
asked Feb 9 at 1:42
AndreeCrist
1133
1133
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
You can do
$ screen -ls
This will list all the screen sessions like this.
There are screens on:
8365.pts-6.vm2 (Attached)
7317.pts-1.vm2 (Attached)
2 Sockets in /var/run/screen/S-root.
Then you can detach any screen session with the help of screen id.
For eg:
$ screen -d 8365
[8365.pts-6.vm2 detached.]
add a comment |Â
up vote
3
down vote
ThereâÂÂs no need to use ttyecho
to detach the screen
session, you can ask screen
to do it for you:
screen -d pts-2
This will detach the session matching the name âÂÂpts-2âÂÂ, which by default would match a screen session started on pts/2
.
Genius, easy when you know how. Thanks Stephen
â AndreeCrist
Feb 9 at 7:16
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You can do
$ screen -ls
This will list all the screen sessions like this.
There are screens on:
8365.pts-6.vm2 (Attached)
7317.pts-1.vm2 (Attached)
2 Sockets in /var/run/screen/S-root.
Then you can detach any screen session with the help of screen id.
For eg:
$ screen -d 8365
[8365.pts-6.vm2 detached.]
add a comment |Â
up vote
1
down vote
accepted
You can do
$ screen -ls
This will list all the screen sessions like this.
There are screens on:
8365.pts-6.vm2 (Attached)
7317.pts-1.vm2 (Attached)
2 Sockets in /var/run/screen/S-root.
Then you can detach any screen session with the help of screen id.
For eg:
$ screen -d 8365
[8365.pts-6.vm2 detached.]
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You can do
$ screen -ls
This will list all the screen sessions like this.
There are screens on:
8365.pts-6.vm2 (Attached)
7317.pts-1.vm2 (Attached)
2 Sockets in /var/run/screen/S-root.
Then you can detach any screen session with the help of screen id.
For eg:
$ screen -d 8365
[8365.pts-6.vm2 detached.]
You can do
$ screen -ls
This will list all the screen sessions like this.
There are screens on:
8365.pts-6.vm2 (Attached)
7317.pts-1.vm2 (Attached)
2 Sockets in /var/run/screen/S-root.
Then you can detach any screen session with the help of screen id.
For eg:
$ screen -d 8365
[8365.pts-6.vm2 detached.]
answered Feb 9 at 9:57
Abhi1227
1511
1511
add a comment |Â
add a comment |Â
up vote
3
down vote
ThereâÂÂs no need to use ttyecho
to detach the screen
session, you can ask screen
to do it for you:
screen -d pts-2
This will detach the session matching the name âÂÂpts-2âÂÂ, which by default would match a screen session started on pts/2
.
Genius, easy when you know how. Thanks Stephen
â AndreeCrist
Feb 9 at 7:16
add a comment |Â
up vote
3
down vote
ThereâÂÂs no need to use ttyecho
to detach the screen
session, you can ask screen
to do it for you:
screen -d pts-2
This will detach the session matching the name âÂÂpts-2âÂÂ, which by default would match a screen session started on pts/2
.
Genius, easy when you know how. Thanks Stephen
â AndreeCrist
Feb 9 at 7:16
add a comment |Â
up vote
3
down vote
up vote
3
down vote
ThereâÂÂs no need to use ttyecho
to detach the screen
session, you can ask screen
to do it for you:
screen -d pts-2
This will detach the session matching the name âÂÂpts-2âÂÂ, which by default would match a screen session started on pts/2
.
ThereâÂÂs no need to use ttyecho
to detach the screen
session, you can ask screen
to do it for you:
screen -d pts-2
This will detach the session matching the name âÂÂpts-2âÂÂ, which by default would match a screen session started on pts/2
.
edited Feb 9 at 8:02
answered Feb 9 at 5:12
Stephen Kitt
142k22308369
142k22308369
Genius, easy when you know how. Thanks Stephen
â AndreeCrist
Feb 9 at 7:16
add a comment |Â
Genius, easy when you know how. Thanks Stephen
â AndreeCrist
Feb 9 at 7:16
Genius, easy when you know how. Thanks Stephen
â AndreeCrist
Feb 9 at 7:16
Genius, easy when you know how. Thanks Stephen
â AndreeCrist
Feb 9 at 7:16
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422949%2fhow-to-remotely-detach-a-screen-from-another-terminal%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password