Ubuntu on Windows as VS Code terminal - executable path

左心房为你撑大大i 提交于 2019-12-21 21:39:49

问题


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.


回答1:


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




回答2:


  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!


来源:https://stackoverflow.com/questions/47473965/ubuntu-on-windows-as-vs-code-terminal-executable-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!