DEV Community

Rodrigo Burgos
Rodrigo Burgos

Posted on

Short: How to use VSCode on WSL2

Open bashrc

nano ~/.bashrc

Add this on the end of the file:

export PATH=$PATH:/mnt/c/Users/<YourUsername>/AppData/Local/Programs/Microsoft\ VS\ Code/bin
Enter fullscreen mode Exit fullscreen mode

Apply the changes:

source ~/.bashrc

Test the code command: Now, try running code . in the WSL2 terminal again:

code .

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs