ref(connectable tab) getRecoveryToken method

This commit is contained in:
Clem Fern
2023-05-12 20:06:40 +02:00
parent bd4b11813c
commit 38b8702373
4 changed files with 10 additions and 24 deletions

View File

@@ -6,6 +6,8 @@ import { first } from 'rxjs'
import { BaseTerminalProfile } from './interfaces'
import { BaseTerminalTabComponent } from './baseTerminalTab.component'
import { GetRecoveryTokenOptions } from 'tabby-core'
/**
* A class to base your custom connectable terminal tabs on
@@ -69,6 +71,14 @@ export abstract class ConnectableTerminalTabComponent<P extends BaseTerminalProf
}
}
async getRecoveryToken (options?: GetRecoveryTokenOptions): Promise<any> {
return {
type: `app:${this.profile.type}-tab`,
profile: this.profile,
savedState: options?.includeState && this.frontend?.saveState(),
}
}
async reconnect (): Promise<void> {
this.session?.destroy()
await this.initializeSession()