keep "disable dynamic title" while duplicating or restoring a tab - fixes #4334

This commit is contained in:
Eugene Pankov 2021-08-04 19:51:08 +02:00
parent 28b84e38ca
commit fa70447223
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
5 changed files with 11 additions and 9 deletions

View File

@ -93,13 +93,13 @@ export class SplitContainer {
return s return s
} }
async serialize (): Promise<RecoveryToken> { async serialize (tabsRecovery: TabRecoveryService): Promise<RecoveryToken> {
const children: any[] = [] const children: any[] = []
for (const child of this.children) { for (const child of this.children) {
if (child instanceof SplitContainer) { if (child instanceof SplitContainer) {
children.push(await child.serialize()) children.push(await child.serialize(tabsRecovery))
} else { } else {
children.push(await child.getRecoveryToken()) children.push(await tabsRecovery.getFullRecoveryToken(child))
} }
} }
return { return {
@ -565,7 +565,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
/** @hidden */ /** @hidden */
async getRecoveryToken (): Promise<any> { async getRecoveryToken (): Promise<any> {
return this.root.serialize() return this.root.serialize(this.tabRecovery)
} }
/** @hidden */ /** @hidden */

View File

@ -42,7 +42,7 @@ export class ProfilesService {
tab.setTitle(profile.name) tab.setTitle(profile.name)
} }
if (profile.disableDynamicTitle) { if (profile.disableDynamicTitle) {
tab['enableDynamicTitle'] = false tab['disableDynamicTitle'] = true
} }
return tab return tab
} }

View File

@ -37,6 +37,7 @@ export class TabRecoveryService {
if (tab.color) { if (tab.color) {
token.tabColor = tab.color token.tabColor = tab.color
} }
token.disableDynamicTitle = tab['disableDynamicTitle']
} }
return token return token
} }
@ -54,6 +55,7 @@ export class TabRecoveryService {
tab.inputs = tab.inputs ?? {} tab.inputs = tab.inputs ?? {}
tab.inputs.color = token.tabColor ?? null tab.inputs.color = token.tabColor ?? null
tab.inputs.title = token.tabTitle || '' tab.inputs.title = token.tabTitle || ''
tab.inputs.disableDynamicTitle = token.disableDynamicTitle
return tab return tab
} catch (error) { } catch (error) {
this.logger.warn('Tab recovery crashed:', token, provider, error) this.logger.warn('Tab recovery crashed:', token, provider, error)

View File

@ -111,4 +111,4 @@ export default class SSHModule {
export * from './api' export * from './api'
export { SFTPFile, SFTPSession } from './session/sftp' export { SFTPFile, SFTPSession } from './session/sftp'
export { SFTPPanelComponent } export { SFTPPanelComponent, SFTPContextMenuItemProvider }

View File

@ -98,9 +98,9 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
enablePassthrough = true enablePassthrough = true
/** /**
* Enables receiving dynamic window/tab title provided by the shell * Disables display of dynamic window/tab title provided by the shell
*/ */
enableDynamicTitle = true disableDynamicTitle = false
alternateScreenActive = false alternateScreenActive = false
@ -586,7 +586,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
} }
this.termContainerSubscriptions.subscribe(this.frontend.title$, title => this.zone.run(() => { this.termContainerSubscriptions.subscribe(this.frontend.title$, title => this.zone.run(() => {
if (this.enableDynamicTitle) { if (!this.disableDynamicTitle) {
this.setTitle(title) this.setTitle(title)
} }
})) }))