mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-29 13:35:34 +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)
|
this.splitAdjusted.next(spanner)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
destroy () {
|
||||||
|
super.destroy()
|
||||||
|
for (const x of this.getAllTabs()) {
|
||||||
|
x.destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private attachTabView (tab: BaseTabComponent) {
|
private attachTabView (tab: BaseTabComponent) {
|
||||||
const ref = this.viewContainer.insert(tab.hostView) as EmbeddedViewRef<any> // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
|
const ref = this.viewContainer.insert(tab.hostView) as EmbeddedViewRef<any> // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
|
||||||
this.viewRefs.set(tab, ref)
|
this.viewRefs.set(tab, ref)
|
||||||
|
@ -255,15 +255,15 @@ export class Session extends BaseSession {
|
|||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
this.kill('SIGTERM')
|
this.kill('SIGTERM')
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
if (!this.open) {
|
try {
|
||||||
resolve()
|
process.kill(this.pty.pid, 0)
|
||||||
} else {
|
// still alive
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.open) {
|
|
||||||
this.kill('SIGKILL')
|
this.kill('SIGKILL')
|
||||||
}
|
|
||||||
resolve()
|
resolve()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
} catch {
|
||||||
|
resolve()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user