mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-28 21:13:18 +03:00
fixed shell process not being killed on tab close
This commit is contained in:
parent
94d91f8182
commit
7b6cdb274c
@ -436,6 +436,13 @@ export class SplitTabComponent extends BaseTabComponent implements OnInit, OnDes
|
||||
this.splitAdjusted.next(spanner)
|
||||
}
|
||||
|
||||
destroy () {
|
||||
super.destroy()
|
||||
for (const x of this.getAllTabs()) {
|
||||
x.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
private attachTabView (tab: BaseTabComponent) {
|
||||
const ref = this.viewContainer.insert(tab.hostView) as EmbeddedViewRef<any> // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
|
||||
this.viewRefs.set(tab, ref)
|
||||
|
@ -255,15 +255,15 @@ export class Session extends BaseSession {
|
||||
await new Promise((resolve) => {
|
||||
this.kill('SIGTERM')
|
||||
setImmediate(() => {
|
||||
if (!this.open) {
|
||||
resolve()
|
||||
} else {
|
||||
try {
|
||||
process.kill(this.pty.pid, 0)
|
||||
// still alive
|
||||
setTimeout(() => {
|
||||
if (this.open) {
|
||||
this.kill('SIGKILL')
|
||||
}
|
||||
resolve()
|
||||
}, 1000)
|
||||
} catch {
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user