Add (Local) to the local terminal title

Part of microsoft/vscode-remote-release#730
This commit is contained in:
Daniel Imms 2019-06-19 11:55:53 -07:00
parent 40bbb20c60
commit 3ccdd1e63d

View file

@ -34,6 +34,15 @@ export class CreateNewLocalTerminalAction extends Action {
if (!instance) {
return Promise.resolve(undefined);
}
// Append (Local) to the first title that comes back, the title will then become static
const disposable = instance.onTitleChanged(() => {
if (instance.title && instance.title.trim().length > 0) {
disposable.dispose();
instance.setTitle(`${instance.title} (Local)`, false);
}
});
this.terminalService.setActiveInstance(instance);
return this.terminalService.showPanel(true);
}