mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
Merge branch 'master' of github.com:Eugeny/tabby
This commit is contained in:
@@ -129,6 +129,7 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
protected output = new Subject<string>()
|
||||
protected binaryOutput = new Subject<Buffer>()
|
||||
protected sessionChanged = new Subject<BaseSession|null>()
|
||||
protected recentInputs = ''
|
||||
private bellPlayer: HTMLAudioElement
|
||||
private termContainerSubscriptions = new SubscriptionContainer()
|
||||
private sessionHandlers = new SubscriptionContainer()
|
||||
@@ -415,6 +416,11 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
this.frontend!.write('\r\n\r\n')
|
||||
}
|
||||
}
|
||||
|
||||
this.input$.subscribe(data => {
|
||||
this.recentInputs += data
|
||||
this.recentInputs = this.recentInputs.substring(this.recentInputs.length - 32)
|
||||
})
|
||||
}
|
||||
|
||||
async buildContextMenu (): Promise<MenuItemOptions[]> {
|
||||
@@ -765,11 +771,12 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
}
|
||||
})
|
||||
|
||||
if (destroyOnSessionClose) {
|
||||
this.attachSessionHandler(this.session.closed$, () => {
|
||||
this.attachSessionHandler(this.session.closed$, () => {
|
||||
const behavior = this.profile.behaviorOnSessionEnd
|
||||
if (destroyOnSessionClose || behavior === 'close' || behavior === 'auto' && this.isSessionExplicitlyTerminated()) {
|
||||
this.destroy()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
this.attachSessionHandler(this.session.destroyed$, () => {
|
||||
this.setSession(null)
|
||||
@@ -835,4 +842,11 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
cb(this)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the user explicitly exit the session
|
||||
*/
|
||||
protected isSessionExplicitlyTerminated (): boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user