vscode-settings - 使用 settings.json 在 VSCODE 中设置集成终端名称
问题描述
有一些与重命名或设置终端配置文件相关的问题:
但是如果你想通过每个文件夹的 settings.json 来定义它,你会怎么做呢?
解决方案
答案是只能为工作区做。
Workspace.code-workspace 例如:
{
"settings": {
"powershell.powerShellDefaultVersion": "PowerShell (x64)",
"python.envFile": "${workspaceFolder}/.venv",
"terminal.integrated.profiles.windows": {
"myprofilename": {
"source": "PowerShell",
"overrideName": true,
"icon": "terminal-powershell"
}
}
}
}
这将创建myprofilename
作为新终端选项的选择。
但是,如果要在多根工作区中设置默认值,请在文件夹级别:
例如:somefolder_in_workspace/.vscode/settings.json:
{
"terminal.integrated.defaultProfile.windows": "myprofilename"
}
如果您将鼠标悬停,您会看到该行显示为灰色并显示一条消息:This setting cannot be applied in this workspace. It will be applied when you open the containing workspace folder directly.
这是文档解释行为的方式:
为避免设置冲突,使用多根工作区时仅应用资源(文件、文件夹)设置。影响整个编辑器的设置(例如 UI 布局)将被忽略。例如,两个项目不能同时设置缩放级别。
因此,对于多根工作区中的文件夹,答案是否定的,但是如果您想要工作区终端的名称,则答案是肯定的
推荐阅读
- ios - dyld:库未加载:@rpath/libswiftAVFoundation.dylib | 扑
- python - 将 .dat 文件加载到 pandas 数据框中
- c - 没有得到输出,没有发现错误(c语言)
- javascript - React:与 componentDidUpdate 相比如何使用 useEffect?
- angular - zone.js 无法解析
- reactjs - 如何使用 Jest 和 Enzyme 测试 useMemo 挂钩中的功能?
- javascript - Odoo14:使用 Javascript 和 postMessage 从 iframe 调用 python 函数
- html - 如何在搜索引擎中搜索特定名称输入并使用 R 从网站下载多个文件?
- google-apps-script - 插入新数据而不是复制整行 Google 表格
- mysql - 在 Go 中使用 `database/sql` 更新很慢