Mil*_*ics 8 powershell node.js visual-studio-code
我尚未成功,但我重新安装了 Visual Studio Code,并且无法再次向其中添加节点终端。
请不要说我也可以使用 bash 运行并使用 powershell。这两个在Vscode中默认可达。
但我想更改默认终端并更改为节点终端。不是 powershell 也不是 cmd...
我在这个主题上搜索了很多网站,但都没有找到解决方案。有解决办法。我今天在 vs code 中使用了节点终端。
所以我应该看到节点而不是 powershell 或 cmd。
抱歉,如果解释很多,但我想非常清楚......
有关 Visual Studio Code 中使用的所有类型 shell的概述,请参阅此答案。
自定义 shell 配置文件保存在settings.json
文件中;要打开它进行编辑,请Preferences: Open Settings (JSON)
从命令选项板 ( Ctrl-Shift-P) 中进行选择。
有一些名为的特定于平台的属性terminal.integrated.profiles.*
,其中*
是windows
、linux
或osx
(macOS)。
每个定义外壳配置文件内的属性,即可通过标记为(的下拉菜单)在集成终端中运行的外壳+
)。
每个shell-profile 定义:
至少需要一个path
指定 shell 可执行文件的完整路径的参数,或者仅在 Windows 上需要一个source
参数,该参数可以是PowerShell
或Git Bash
让 VS Code 找到适当的可执行文件。
启动参数通过 指定args
。
有关所有支持的属性,请参阅文档。
设置默认shell 配置文件:
要么:使用Terminal: Select Default Profile
命令面板中的命令:将显示所有定义的配置文件的列表;选择感兴趣的一项。
或者:将适合平台的terminal.integrated.defaultProfile.*
属性设置为所需 shell 配置文件的名称。
示例:在 Windows 上将 Node.js ( ) 定义node.exe
为自定义 shell 配置文件:
node.exe
和转义字符;\
例如,来自 PowerShell:# Get node.exe's full path, escape '\' chars., copy to the clipboard.
(Get-Command node.exe).Path.Replace('\', '\\') | Set-Clipboard
Run Code Online (Sandbox Code Playgroud)
settings.json
文件中(如果该terminal.integrated.profiles.windows
属性已存在,只需将属性添加Node.js
到其中即可);该示例使用 的node.exe
默认安装位置C:\Program Files\nodejs\node.exe
。"terminal.integrated.profiles.windows": {
"Node.js": {
"path": "C:\\Program Files\\nodejs\\node.exe",
"args": [] // Add startup arguments as needed.
}
},
// Make Node.js the default shell (if the property already exists, update its value).
"terminal.integrated.defaultProfile.windows": "Node.js",
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
19173 次 |
最近记录: |