This question is about the linux utility screen.
I'd like to make a script to launch a program in screen then detatch it automatically after it starts.
I've got the script starting screen, starting the command in screen, but my question is now how do I detach it?
Thanks
Basic Linux Screen Usage Use the key sequence Ctrl-a + Ctrl-d to detach from the screen session. Reattach to the screen session by typing screen -r .
Detatch from the screen session using the key sequence Ctrl-a Ctrl-d (note that all screen key bindings start with Ctrl-a ). This will drop you back to your original shell and display a message "[detached]", indicating that the screen session is still running.
Use ctrl + a , a to send ctrl + a to the inner screen. That is, to detach the inner screen press ctrl + a , a , d .
Don't attach in the first place. From the screen manual:
-d -m Start screen in "detached" mode. This creates a new session but
doesn't attach to it. This is useful for system startup
scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With