fix(subprocess): retain failed terminal cleanup

This commit is contained in:
Tianyi Cui
2026-07-29 08:00:21 +08:00
parent a95e01d8b0
commit 06a9224904
2 changed files with 29 additions and 4 deletions

View File

@@ -64,10 +64,9 @@ export class LocalSubprocessService extends SubprocessService {
// an identity-fenced descendant survives escalation). Await the cleanup
// transaction directly so disposal reports that failure rather than
// waiting forever on `done`.
pending.push(terminal.waitForExit())
pending.push(terminal.waitForExit().then(() => { this.terminals.delete(terminal) }))
}
this.live.clear()
this.terminals.clear()
await Promise.all(pending)
await rm(this.runtimeRoot, { recursive: true, force: true })
}, 'local subprocess teardown')