mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 17:28:06 +00:00
fixed one-off sessions not auto closing
This commit is contained in:
parent
f7b603a631
commit
fe8dd891b4
1 changed files with 5 additions and 4 deletions
|
@ -147,6 +147,7 @@ export abstract class BaseSession {
|
|||
/** @hidden */
|
||||
export class Session extends BaseSession {
|
||||
private pty: PTYProxy|null = null
|
||||
private ptyClosed = false
|
||||
private pauseAfterExit = false
|
||||
private guessedCWD: string|null = null
|
||||
private reportedCWD: string
|
||||
|
@ -246,6 +247,7 @@ export class Session extends BaseSession {
|
|||
})
|
||||
|
||||
this.pty.subscribe('close', () => {
|
||||
this.ptyClosed = true
|
||||
if (this.pauseAfterExit) {
|
||||
this.emitOutput(Buffer.from('\r\nPress any key to close\r\n'))
|
||||
} else if (this.open) {
|
||||
|
@ -267,12 +269,11 @@ export class Session extends BaseSession {
|
|||
}
|
||||
|
||||
write (data: Buffer): void {
|
||||
if (this.ptyClosed) {
|
||||
this.destroy()
|
||||
}
|
||||
if (this.open) {
|
||||
this.pty?.write(data)
|
||||
// TODO if (this.pty._writable) {
|
||||
// } else {
|
||||
// this.destroy()
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue