Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detach from docker container from integrated terminal (send [CTRL + P CTRL + Q]

I'm just wondering how to properly detach a running container if it was started from VSCode's integrated terminal?

On a Mac CTRL+P CTRL+Q doesn't work.

like image 794
Luís Correia Avatar asked Apr 02 '19 22:04

Luís Correia


People also ask

How do I detach a docker container from terminal?

To stop a container, use CTRL-c . This key sequence sends SIGKILL to the container. If --sig-proxy is true (the default), CTRL-c sends a SIGINT to the container. If the container was run with -i and -t , you can detach from a container and leave it running using the CTRL-p CTRL-q key sequence.

What happens when you press Ctrl-P Q inside the container in Docker?

Run Hub docker container Note that pressing `Ctrl+C` when the terminal is attached to a container output causes the container to shut down. Use `Ctrl+PQ` in order to detach the terminal from container output.

How do I disconnect without exiting the container?

if you want to detach from container without exiting(without killing the bash shell), By default , you can use ctrl-p,q . it will come out of container without exiting from the container(running background.

How do I start a docker container in detached mode?

To start a container in detached mode, you use -d=true or just -d option. By design, containers started in detached mode exit when the root process used to run the container exits, unless you also specify the --rm option.


1 Answers

Menu under File > Preferences > Keyboard Shortcuts. (Code > Preferences > Keyboard Shortcuts on macOS)

Add !terminalFocus to When option for CTRL+Q

enter image description here

like image 140
Allen Zhou Avatar answered Sep 22 '22 11:09

Allen Zhou