Skip to content

VS Code and WSL

Launching VS Code from the Terminal

  1. You can launch VS Code directly from a WSL-ROS2 terminal instance. Simply type code . at the terminal prompt and then hit Enter :

    code .
    
  2. A warning message may then pop up:

    Check the box to "Permanently allow ..." and then click the Allow button.

  3. 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

  1. 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.

    Don't see the pop-up?

    You can also install the 'WSL' extension manually.

    Click on the "Extensions" icon in the left-hand toolbar (or hit Ctrl+Shift+X ), type "wsl" in the search box and hit the install button on the right extension, as show below:

  2. 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.

  3. 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!