Skip to content

Commit c32c239

Browse files
committed
fix(tui): Ensure to exit process when quitting the tui
1 parent b247610 commit c32c239

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

apps/tui/src/index.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,20 @@ function App() {
294294
return api.cancelTask(run.id);
295295
})
296296
);
297+
quit();
298+
}
299+
300+
function quit() {
297301
renderer.destroy();
302+
process.exit(0);
298303
}
299304

300305
function requestQuit() {
301306
if (hasRunningTasks()) {
302307
setShowQuitConfirmation(true);
303308
return;
304309
}
305-
renderer.destroy();
310+
quit();
306311
}
307312

308313
function handleQuitConfirmationKeys() {
@@ -667,11 +672,9 @@ function App() {
667672
isCancelling={isCancellingBeforeExit()}
668673
onConfirm={(action) => {
669674
if (action === "cancelAll") {
670-
cancelRunningTasksBeforeExit().catch(() =>
671-
renderer.destroy()
672-
);
675+
cancelRunningTasksBeforeExit().catch(() => quit());
673676
} else {
674-
renderer.destroy();
677+
quit();
675678
}
676679
}}
677680
runningTasks={runningTaskRows()}

0 commit comments

Comments
 (0)