From 0bf870738e5512a84821a7f2140b82b025f7eb8b Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Wed, 10 Mar 2021 21:36:12 +0100 Subject: [PATCH] option to disable dynamic tab title in profiles - fixes #3574 --- terminus-terminal/src/api/interfaces.ts | 1 + .../src/components/editProfileModal.component.pug | 6 ++++++ terminus-terminal/src/services/terminal.service.ts | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/terminus-terminal/src/api/interfaces.ts b/terminus-terminal/src/api/interfaces.ts index 1f15ac71..aac1992d 100644 --- a/terminus-terminal/src/api/interfaces.ts +++ b/terminus-terminal/src/api/interfaces.ts @@ -22,6 +22,7 @@ export interface Profile { shell?: string isBuiltin?: boolean icon?: string + disableDynamicTitle?: boolean } export interface TerminalColorScheme { diff --git a/terminus-terminal/src/components/editProfileModal.component.pug b/terminus-terminal/src/components/editProfileModal.component.pug index 40338a5c..0ad3dd5b 100644 --- a/terminus-terminal/src/components/editProfileModal.component.pug +++ b/terminus-terminal/src/components/editProfileModal.component.pug @@ -62,6 +62,12 @@ placeholder='#000000' ) + .form-line + .header + .title Disable dynamic tab title + .description Connection name will be used as a title instead + toggle([(ngModel)]='profile.disableDynamicTitle') + .modal-footer button.btn.btn-outline-primary((click)='save()') Save button.btn.btn-outline-danger((click)='cancel()') Cancel diff --git a/terminus-terminal/src/services/terminal.service.ts b/terminus-terminal/src/services/terminal.service.ts index 5f0fbd0c..f4e3351f 100644 --- a/terminus-terminal/src/services/terminal.service.ts +++ b/terminus-terminal/src/services/terminal.service.ts @@ -104,6 +104,10 @@ export class TerminalService { if (profile.color) { (this.app.getParentTab(tab) ?? tab).color = profile.color } + if (profile.disableDynamicTitle) { + tab.enableDynamicTitle = false + tab.setTitle(profile.name) + } return tab }