Ubuntu on Windows as VS Code terminal - executable path

There is a related question but it details the approach for WSL, in newer versions of Windows, the Linux distributions are not beta anymore and they are provided through the MS app store.

Where do I find the path to Ubuntu on Windows executable? (Not WSL.) I tried right-clicking on the icon to find Properties, but it is not there, it seems to be some special kind of a shortcut.

Upvotes: 2

Views: 1415

Answers (2)

Gaurav N
Gaurav N

Reputation: 405

  1. Open VSCode Settings Ctrl + , or File > Prefrences > Settings
  2. User Settings will open up. Add the following in that file:

    "terminal.integrated.shell.windows": "C:\Windows\System32\bash.exe"

  3. Save and close the user settings file.

  4. Enjoy bash in VSCode!

Upvotes: 0

Red Riding Hood
Red Riding Hood

Reputation: 2444

If you have multiple distros installed, you can read this how to launch one individually.

https://msdn.microsoft.com/en-us/commandline/wsl/wsl-config

However if you only have 1 installed, it will pick that one by default

There are three ways to launch and run WSL:

wsl.exe or bash.exe
wsl -c [command] or bash -c [command]
[distro] ie ubuntu -- this is the same as launching the installed app from the Windows menu.

In the first two cases, WSL must pick a distribution to run - a default distribution. If you don't explicitly set a default, it will be the first one installed.

So you can continue to simply use bash.exe

Upvotes: 3

Related Questions