Using Visual Studio Code's Terminal with WSL2

📅   ⌚ 1 minutes  

If you are using WSL2 (Windows Subsystem for Linux 2) then you might be wondering why you can't use the bash or zsh terminal inside of VSCode.

In this tutorial, I will be showing you how you can.

To use your WSL2 terminal inside of VSCode you will need to follow a couple of simple steps.

  • 1. Install the Remote WSL extension in VSCode.
  • 2. Navigate to the directory you want to open as a workspace in your Windows terminal.
  • 3. Make sure you have permissions by entering this code sudo chown -R user /path otherwise you might have a problem with code . not working (that comes next).
  • Note: User is your WSL2 username and the path is the directory you should now be in.

  • 4. Type code . into the terminal and hit enter

That's it. Now you should be running VSCode in the specified workspace with full-permissions and you can use your bash or zsh terminal as normal.