问题
I installed Ubuntu App on Windows 10 and I would like to use it as a terminal in VS Code. I see VS Code automatically detecting options like Git Bash, PowerShell, Cmd.exe and gives options to use them as terminal. But I would like to use Ubuntu. Is it possible?
回答1:
For specifically using Ubuntu distro you just have to type a simple command to change the default distro used by wsl to ubuntu.
Type wslconfig /setdefault Ubuntu
in cmd thats it.
Then in my pc vscode gave me option to choose which terminal i wanted to use so i selected wsl bash so it edited the user settings "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe"
in Preferences->settings . The above code overrides the default setting.
Your pc may have a different path so refer to stackoverflow link to configure vscode for wsl as terminal
you can also refer to the microsoft link for wsl configuration https://docs.microsoft.com/en-us/windows/wsl/wsl-config
you can refer to similar question as yours for ubuntu and multiple distros
来源:https://stackoverflow.com/questions/47462714/how-to-configure-vs-code-windows-to-use-ubuntu-app-as-terminal