diff --git a/src/commands/default.ts b/src/commands/default.ts index 73f1771..4c3db6a 100644 --- a/src/commands/default.ts +++ b/src/commands/default.ts @@ -15,11 +15,6 @@ export const defaultCommand: Command = { process.env.CONFIDENCE_TELEMETRY = 'false'; } - const { cleanup } = await startTui({ dryRun, debug, dir }); - - process.on('SIGINT', () => { - cleanup(); - process.exit(0); - }); + await startTui({ dryRun, debug, dir }); }, }; diff --git a/src/ui/tui/start-tui.ts b/src/ui/tui/start-tui.ts index baaae76..ce83e21 100644 --- a/src/ui/tui/start-tui.ts +++ b/src/ui/tui/start-tui.ts @@ -12,20 +12,8 @@ export async function startTui(opts?: StoreOptions) { const instance = render(React.createElement(App), { exitOnCtrlC: true, + alternateScreen: !debug, }); - if (!debug) { - process.stdout.write('\x1B[2J\x1B[H'); - } - - function cleanup() { - instance.unmount(); - if (!debug) { - process.stdout.write('\x1B[2J\x1B[H'); - } - } - await instance.waitUntilExit(); - - return { cleanup }; }