VS Code and WSL
Launching VS Code from the Terminal¶
-
You can launch VS Code directly from a WSL-ROS2 terminal instance. Simply type
code .
at the terminal prompt and then hit Enter : -
A warning message may then pop up:
Check the box to "Permanently allow ..." and then click the
Allow
button. -
VS Code should then launch, and you'll be presented with another trust dialogue:
Click the blue
Yes, I trust the authors
button.
Installing the WSL Extension¶
-
The first time you launch VS Code (as above) you should be presented with a pop-up in the bottom-right of the screen, asking if you would like to "install the recommended 'WSL' extension from Microsoft..."
Click on the blue "Install" button.
-
Once installed, close down VS Code, go back to the WSL-ROS2 terminal instance and re-launch it using the
code .
command again.This time, you'll be presented with yet another trust pop-up dialogue. Once again, check the box to "Trust the authors" and then click the blue
Yes, I trust the authors
button. -
You can now navigate the WSL-ROS2 filesystem in the explorer window on the left-hand side of the VS Code screen. You'll need to use this to locate the packages and scripts that you create throughout this course!
Always make sure that the "WSL" extension is enabled!!¶
Check that your blue "Remote Window" icon in the bottom-left of the VS Code screen always looks like this:
If not, then go back to the top of this page and try again!