Linux Format

THE COMMAND PALETTE

-

You can access more VS Code WSL commands by using the shortcut Ctrl+Shift+P to bring up the command palette.

Type wsl to list options. One of the most useful is Connect To WSL Using Distro. If you select this, VS Code displays a list of all installed Linux distros. You can also click Add New to list more and launch the installer from VS Code. This must be done locally – you must have closed the ‘remote’ WSL connection from VS Code first.

If you then run Connect To WSL Using Distro once again and choose the newly installed OS, VS Code also installs the necessary server software on your target system so it can connect.

If your program is stored in a specific place, save the trouble of navigating to it via Windows Terminal by using Open Folder In WSL. If you’re connected to an WSL instance, you can navigate from here to the directory containing your code. As before, click Show Local to display the ‘local’ Windows filesystem. If this is too much trouble, the Command Palette also contains a Reopen Folder In Windows option.

We recommend the Help command that links to Visual Studio’s documentat­ion on WSL (https://code.visualstud­io.com/docs/ remote/wsl). From here you can learn more about how the

WSL extension works in VS Code, such as the fact it can run other extensions and commands directly. This is also where we learned that you can open an WSL window directly from VS Code: just press F1, then select WSL: Connect to WSL to launch your default distro.

You may want to follow the link to install the Remote Developmen­t Extension Pack with its extensions for WSL, SSH and containers.

Newspapers in English

Newspapers from Australia