Linux is a cancer that attaches itself in an intellectual property sense to everything it touches.
Steve Ballmer, Microsoft CEO, June 2001
This ain’t yer Dad’s Microsoft…
In the past few years, Microsoft has made Visual Studio Code, the free code editor that runs everywhere, into the preferred choice of many developers. And, rather than relentlessly pushing their own alternative, they’ve built the Linux command line into Windows as the Windows Subsystem for Linux.
If you’re like me, you’ve already set up both your WSL Linux shell and your VS Code environment just how you like ’em. But when you open the integrated terminal, you’re disappointed to see a Powershell prompt …
Let’s fix that …
tl;dr
- Set your integrated shell:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe"
- Install the Remote Development Extension Pack
- Open your project from the Linux shell
- Install extensions in WSL
[ez-toc]
Use the right shell
By default, VS Code uses Powershell on Windows 10, but it’s easy to change. Just set the path to your WSL executable as the integrated shell for Windows in your settings:
- Click the gear icon near the lower left corner.
- Click Settings, then click the curly braces near the upper right corner.
- This opens the
settings.json
file directly rather than using the GUI to change the setting. If you prefer the GUI, read more below.
- This opens the
- Add a property for
terminal.integrated.shell.windows
and set it to the full path towsl.exe
.- You have to double-up the backslashes in the path definition because JSON uses the backslash as an escape character.
- Don’t forget to add a comma at the end of the previous entry, or at the end of this new entry if you’re not putting it at the end.
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe"
If you prefer to change settings in the GUI:
Note that this has to go in the User settings. For “enhanced security“, you can’t set a different shell for each workspace (project).
Make VS Code work in Linux
We’ve configured VS Code to open the Linux shell in the integrated terminal, but it still runs itself in the Windows environment. This is a problem for extensions that work by processing the output of command line tools. You could install them in the Windows shell, but you you wouldn’t be here if you wanted to work in the Windows shell. Besides, most of these tools were written for a *NIX shell. Installation on Windows usually isn’t easy, well-documented, or frequently updated when compared to installation in a Linux shell.

As of the May 2019 release (or sooner if you’re using VS Code Insiders), Microsoft has provided a solution for this problem in the Remote Development Extension Pack. Remote – WSL (included in the pack) allows VS Code, running from Windows, to work with your code in the Linux shell.
The first time you run VS Code from the Linux shell after installing the extension pack, it’ll spend some time “Installing VS Code Server”.
Install Extensions in WSL
Now that everything’s ready to go, you have to tell VS Code which of your extensions you want to work in WSL. Extensions that are already installed locally will have an “Install on WSL” button. Extensions that aren’t installed yet will install on WSL by default when you’re working in a WSL project.