显然 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.title
和 terminal.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/