allow disabling ssh dynamic tab title (fixes #2240, fixes #2027)

This commit is contained in:
Eugene Pankov
2020-03-12 18:17:36 +01:00
parent c4297f2b2b
commit aace3f42d0
4 changed files with 20 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ export interface SSHConnection {
color?: string color?: string
x11?: boolean x11?: boolean
skipBanner?: boolean skipBanner?: boolean
disableDynamicTitle?: boolean
algorithms?: {[t: string]: string[]} algorithms?: {[t: string]: string[]}
} }

View File

@@ -85,9 +85,16 @@
placeholder='#000000' placeholder='#000000'
) )
.form-line
.header
.title Disable dynamic tab title
.description Connection name will be used as a title instead
toggle([(ngModel)]='connection.disableDynamicTitle')
.form-line .form-line
.header .header
.title Skip MoTD/banner .title Skip MoTD/banner
.description Will prevent the SSH greeting from showing up
toggle([(ngModel)]='connection.skipBanner') toggle([(ngModel)]='connection.skipBanner')
.form-line .form-line

View File

@@ -33,6 +33,8 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
ngOnInit (): void { ngOnInit (): void {
this.logger = this.log.create('terminalTab') this.logger = this.log.create('terminalTab')
this.enableDynamicTitle = !this.connection.disableDynamicTitle
this.homeEndSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => { this.homeEndSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
if (!this.hasFocus) { if (!this.hasFocus) {
return return

View File

@@ -63,6 +63,11 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
*/ */
enablePassthrough = true enablePassthrough = true
/**
* Enables receiving dynamic window/tab title provided by the shell
*/
enableDynamicTitle = true
// Deps start // Deps start
config: ConfigService config: ConfigService
element: ElementRef element: ElementRef
@@ -375,7 +380,11 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
} }
this.termContainerSubscriptions = [ this.termContainerSubscriptions = [
this.frontend.title$.subscribe(title => this.zone.run(() => this.setTitle(title))), this.frontend.title$.subscribe(title => this.zone.run(() => {
if (this.enableDynamicTitle) {
this.setTitle(title)
}
})),
this.focused$.subscribe(() => this.frontend.enableResizing = true), this.focused$.subscribe(() => this.frontend.enableResizing = true),
this.blurred$.subscribe(() => this.frontend.enableResizing = false), this.blurred$.subscribe(() => this.frontend.enableResizing = false),