Search code examples
vscode-remote

Can I keep vscode Terminal connected to host machine while in Docker environment using Remote Containers extension?


I have the Remote Containers extension setup so I can jump into a docker container for autocomplete etc. That's working how I want it to.

But it also sets the Terminal window to be inside that environment and I want to instead keep the Terminal window connected to my host machine. I can understand why it's useful to have Terminal from inside the container, but it's not useful for my usecase and it breaks some of my testing tools.


Solution

  • There are 2 commands in VS Code to open terminal windows when using Remote Containers extension:

    Terminal: Create New Integrated Terminal will open a terminal window within a container.

    Terminal: Create New Integrated Terminal (Local) will open a terminal on your host machine.

    enter image description here

    Latter doesn't seem to have have a key binding assigned, so you may want to add one.