Merge branch 'master' of github.com:Eugeny/tabby

This commit is contained in:
Eugene Pankov
2023-04-23 21:34:17 -07:00
8 changed files with 120 additions and 52 deletions

View File

@@ -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
}
}