未验证 提交 c3d5c8fb 编写于 作者: M Megan Rogge

fix #133538

上级 420436d4
......@@ -1214,24 +1214,21 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
this.refreshTabLabels(this._shellLaunchConfig.name, TitleEventSource.Api);
} else {
// Only listen for process title changes when a name is not provided
if (this._configHelper.config.tabs.title.includes('${sequence}') || this._configHelper.config.tabs.description.includes('${sequence}')) {
// Set the title to the first event if the sequence hasn't set it yet
Event.once(this._processManager.onProcessTitle)(e => {
if (!this._title) {
this.refreshTabLabels(e, TitleEventSource.Sequence);
}
});
// Listen to xterm.js' sequence title change event, trigger this async to ensure
// _xtermReadyPromise is ready constructed since this is called from the ctor
setTimeout(() => {
this._xtermReadyPromise.then(xterm => {
this._messageTitleDisposable = xterm.onTitleChange(e => this._onTitleChange(e));
});
// Set the title to the first event if the sequence hasn't set it yet
Event.once(this._processManager.onProcessTitle)(e => {
if (!this._title) {
this.refreshTabLabels(e, TitleEventSource.Sequence);
}
});
// Listen to xterm.js' sequence title change event, trigger this async to ensure
// _xtermReadyPromise is ready constructed since this is called from the ctor
setTimeout(() => {
this._xtermReadyPromise.then(xterm => {
this._messageTitleDisposable = xterm.onTitleChange(e => this._onTitleChange(e));
});
} else {
this.refreshTabLabels(this._shellLaunchConfig.executable, TitleEventSource.Process);
this._messageTitleDisposable = this._processManager.onProcessTitle(title => this.refreshTabLabels(title ? title : '', TitleEventSource.Process));
}
});
this.refreshTabLabels(this._shellLaunchConfig.executable, TitleEventSource.Process);
this._messageTitleDisposable = this._processManager.onProcessTitle(title => this.refreshTabLabels(title ? title : '', TitleEventSource.Process));
}
});
this._processManager.onProcessExit(exitCode => this._onProcessExit(exitCode));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册