如何配置 VS Code (windows) 以使用 Ubuntu App 作为终端 [英] How to configure VS Code (windows) to use Ubuntu App as terminal

查看:49
本文介绍了如何配置 VS Code (windows) 以使用 Ubuntu App 作为终端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 10 上安装了 Ubuntu App,我想将它用作 VS Code 中的终端.我看到 VS Code 会自动检测 Git Bash、PowerShell、Cmd.exe 等选项,并提供将它们用作终端的选项.但我想使用 Ubuntu.可能吗?

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?

推荐答案

对于专门使用 Ubuntu 发行版,您只需键入一个简单的命令即可将 wsl 使用的默认发行版更改为 ubuntu.在 cmd 中输入 wslconfig/setdefault Ubuntu 就是这样.

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.

然后在我的电脑中 vscode 给了我选择我想使用哪个终端的选项,所以我选择了 wsl bash,所以它编辑了用户设置 "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe" 在 Preferences->settings 中.上面的代码覆盖了默认设置.

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.

您的电脑可能有不同的路径,因此请参阅 stackoverflow 链接为 wsl 配置 vscode 作为终端

Your pc may have a different path so refer to stackoverflow link to configure vscode for wsl as terminal

你也可以参考微软的 wsl 配置链接 https://docs.microsoft.com/en-us/windows/wsl/wsl-config

you can also refer to the microsoft link for wsl configuration https://docs.microsoft.com/en-us/windows/wsl/wsl-config

您可以参考与您对 ubuntu 和多个发行版

这篇关于如何配置 VS Code (windows) 以使用 Ubuntu App 作为终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆