visual-studio-code - 既然 Terminal.integrated.titleMode 已弃用,是否可以通过 vscode 中的转义序列设置动态终端标题?

标签 visual-studio-code

显然 VSCODE 去年删除了通过转义序列设置自定义终端标题的功能,是否仍然可以通过其他方式执行此操作?

https://github.com/microsoft/vscode/issues/133112

这可以通过之前将terminal.integrated.titleMode设置为sequence来实现。

以下是删除之前描述的设置:

[TerminalSettingId.TitleMode]: {
    description: localize('terminal.integrated.titleMode', "Determines how the terminal's title is set, this shows up in the terminal's tab or dropdown entry."),
    type: 'string',
    enum: ['executable', 'sequence'],
    markdownEnumDescriptions: [
        localize('titleMode.executable', "The title is set by the terminal, the name of the detected foreground process will be used."),
        localize('titleMode.sequence', "The title is set by the process via an escape sequence, this is useful if your shell dynamically sets the title.")
    ],
    default: 'executable'
}

最佳答案

此设置已被更灵活的 terminal.integrated.tabs.titleterminal.integrated.tabs.description 取代。对于旧的 'sequence' 的等效项,请使用:

"terminal.integrated.tabs.title": "${sequence}"

但它比现在灵活得多,例如:

"terminal.integrated.tabs.title": "${process}${separator}${sequence}"
"terminal.integrated.tabs.description": "${workspaceFolder}"

关于visual-studio-code - 既然 Terminal.integrated.titleMode 已弃用,是否可以通过 vscode 中的转义序列设置动态终端标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71542262/

相关文章:

angular - 在 azure 上发布 .net core 2.0 Angular Spa Web 应用程序时出错

visual-studio-code - VS Code Javascript 智能感知不工作

node.js - 从 VS Code 附加到 NodeJS 进程会跳过第一条语句

autocomplete - 反引号、 typescript 、visual studio code 内的自动完成/关闭标签

javascript - 移动或重命名文件时更新导入/需要路径 - 不起作用

visual-studio-code - VSCode 扩展 TreeView 集已选中

node.js - VSCODE 构建错误 `The terminal process "/bin/zsh '-c' , 'yarn run watch-extensionsd' "无法启动(退出代码 : 127). `

visual-studio-code - 防止在保存时自动格式化期间删除无效代码?

visual-studio-code - 如何将 vscode 4 个字母配置为缩进

javascript - 为什么 Visual Studio Code 会自动添加 {""}?