don't include tab state in saved layouts

This commit is contained in:
Eugene Pankov
2022-01-10 20:39:29 +01:00
parent 3a11b51729
commit 61c11abda2
15 changed files with 38 additions and 82 deletions

View File

@@ -1,5 +1,5 @@
import { Component, Input, Injector } from '@angular/core'
import { BaseTabProcess, WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from 'tabby-core'
import { BaseTabProcess, WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild, GetRecoveryTokenOptions } from 'tabby-core'
import { BaseTerminalTabComponent } from 'tabby-terminal'
import { LocalProfile, SessionOptions } from '../api'
import { Session } from '../session'
@@ -74,7 +74,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent {
this.recoveryStateChangedHint.next()
}
async getRecoveryToken (): Promise<any> {
async getRecoveryToken (options?: GetRecoveryTokenOptions): Promise<any> {
const cwd = this.session ? await this.session.getWorkingDirectory() : null
return {
type: 'app:local-tab',
@@ -83,10 +83,10 @@ export class TerminalTabComponent extends BaseTerminalTabComponent {
options: {
...this.profile.options,
cwd: cwd ?? this.profile.options.cwd,
restoreFromPTYID: this.session?.getPTYID(),
restoreFromPTYID: options?.includeState && this.session?.getPTYID(),
},
},
savedState: this.frontend?.saveState(),
savedState: options?.includeState && this.frontend?.saveState(),
}
}

View File

@@ -19,18 +19,4 @@ export class RecoveryProvider extends TabRecoveryProvider<TerminalTabComponent>
},
}
}
duplicate (recoveryToken: RecoveryToken): RecoveryToken {
return {
...recoveryToken,
profile: {
...recoveryToken.profile,
options: {
...recoveryToken.profile.options,
restoreFromPTYID: null,
},
},
savedState: null,
}
}
}