resolves Eugeny/tabby#7751, Eugeny/tabby#8062, Eugeny/tabby#6617 add configurable behavior when session ends

This commit is contained in:
Clem
2023-04-12 23:20:06 +02:00
parent c5d79135ab
commit 268af8806c
7 changed files with 79 additions and 32 deletions

View File

@@ -28,7 +28,6 @@ export class TerminalTabComponent extends BaseTerminalTabComponent<LocalProfile>
this.sessionOptions = this.profile.options
this.logger = this.log.create('terminalTab')
this.session = new Session(this.injector)
const isConPTY = isWindowsBuild(WIN_BUILD_CONPTY_SUPPORTED) && this.config.store.terminal.useConPTY
@@ -56,6 +55,9 @@ export class TerminalTabComponent extends BaseTerminalTabComponent<LocalProfile>
}
initializeSession (columns: number, rows: number): void {
const session = new Session(this.injector)
if (this.profile.options.runAsAdministrator && this.uac?.isAvailable) {
this.profile = {
...this.profile,
@@ -63,13 +65,13 @@ export class TerminalTabComponent extends BaseTerminalTabComponent<LocalProfile>
}
}
this.session!.start({
session.start({
...this.profile.options,
width: columns,
height: rows,
})
this.attachSessionHandlers(true)
this.setSession(session, this.config.store.terminal.behaviorOnSessionEnds.endsWith('close'))
this.recoveryStateChangedHint.next()
}