我正在使用Zsh,因此建议进行配置。
"terminal.integrated.profiles.osx": {
"zsh": {
"path": "/bin/zsh",
"icon": "star",
"env": {
"TESTING_VAR": "abc"
}
}
},
"terminal.integrated.defaultProfile.osx": "zsh",
如VS Code文档中的配置文件部分所述,当您创建自定义终端配置文件时,它会将一个条目添加到您的settings.json文件中:
The recommended way to create a new profile is to run the Terminal: Select Default Profile command and activate the configure button on the right side of the shell to base it on. This will add a new entry to your settings that can be tweaked manually in your
settings.json
file....
"terminal.integrated.profiles.windows": { "PowerShell -NoProfile": { "source": "PowerShell", "args": ["-NoProfile"] } }, "terminal.integrated.profiles.linux": { "zsh (login)": { "path": "zsh", "args": ["-l"] } }
打开你的用户设置,你会发现terminal.integrated.profiles.<OS>
设置下新增了对应操作系统下你自定义配置文件的条目。最好直接打开settings.json文件,或者从UI“编辑settings.json”中打开它:
设置UI
settings.json
"terminal.integrated.profiles.osx": {
"1": {
"path": "bash"
}
}
(我正在使用Mac OS,所以我的文件在.osx
中。它相应地添加到.linux
或.windows
。)
要删除您的自定义配置文件:
terminal.integrated.profiles
中简单地删除您的自定义配置文件("1": {...}
)当VS Code重新加载/重启时,已删除的自定义配置文件应该不见了。(似乎这些自定义配置文件只在VS Code启动期间被读取和加载一次)。
请注意,这仅适用于自定义配置文件。对于内置配置文件,您必须将配置文件设置为null
:
To remove profile entries from the dropdown, set the name of the profile to null. For example, to remove the Git Bash profile on Windows, use this setting:
"terminal.integrated.profiles.windows": { "Git Bash": null }