Skip to content

Commit 677d841

Browse files
committed
fix(core): capture dump on exit
1 parent 3887bb9 commit 677d841

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/renderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ export class CliRenderer extends EventEmitter implements RenderContext {
365365
private exitHandler: () => void = (() => {
366366
this.destroy()
367367
if (env.OTUI_DUMP_CAPTURES) {
368-
Bun.sleep(100).then(() => {
368+
process.nextTick(() => {
369369
this.dumpOutputCache("=== CAPTURED OUTPUT ===\n")
370370
})
371371
}
@@ -447,7 +447,7 @@ export class CliRenderer extends EventEmitter implements RenderContext {
447447

448448
process.on("uncaughtException", this.handleError)
449449
process.on("unhandledRejection", this.handleError)
450-
process.on("exit", this.exitHandler)
450+
process.on("beforeExit", this.exitHandler)
451451

452452
this._keyHandler = new InternalKeyHandler(config.useKittyKeyboard ?? true)
453453
this._keyHandler.on("keypress", (event) => {

0 commit comments

Comments
 (0)