mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-24 05:19:57 +00:00
keep "disable dynamic title" while duplicating or restoring a tab - fixes #4334
This commit is contained in:
parent
28b84e38ca
commit
fa70447223
@ -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 */
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -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 }
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user