visual-studio-code

How do I change the default terminal for a specific project in VSCode?


I use VSCode for development, mostly development on Windows. However, for a few of my current projects, I am developing for Linux, and would therefore like to use a Linux shell. I have WSL set up, and can use it in VSCode.

The problem: I have Powershell as my default terminal in VSCode, which works great for Windows applications. However, I want to use WSL for my terminal. I could switch to it manually every time, which is what I'm currently doing, but this is mildly annoying. I could set WSL as my default shell globally, but then I'd have to set it back when working on Windows. Is there a way to set a terminal as default for the current project and only the current project?

I have searched this up and could not find results for specifically this; only for setting the global default.


Solution

  • Windows:

    In your project folder, if you do not have a .vscode folder with a settings.json, create one. Within that settings.json, add the line

    "terminal.integrated.defaultProfile.windows": "Ubuntu (WSL)"
    

    You may change "Ubuntu (WSL)" to your preferred terminal provider.