Browse Source

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

Eugene Pankov 4 years ago
parent
commit
fa70447223

+ 4 - 4
tabby-core/src/components/splitTab.component.ts

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

+ 1 - 1
tabby-core/src/services/profiles.service.ts

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

+ 2 - 0
tabby-core/src/services/tabRecovery.service.ts

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

+ 1 - 1
tabby-ssh/src/index.ts

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

+ 3 - 3
tabby-terminal/src/api/baseTerminalTab.component.ts

@@ -98,9 +98,9 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
     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
 
@@ -586,7 +586,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
         }
 
         this.termContainerSubscriptions.subscribe(this.frontend.title$, title => this.zone.run(() => {
-            if (this.enableDynamicTitle) {
+            if (!this.disableDynamicTitle) {
                 this.setTitle(title)
             }
         }))