From b992160e3569fa4c523b4d9160269585492a4862 Mon Sep 17 00:00:00 2001 From: Alex Bespoyasov Date: Tue, 8 Sep 2026 15:35:52 +0200 Subject: [PATCH] fix: use Ink 7's `alternateScreen` to prevent scroll during session --- src/commands/default.ts | 7 +------ src/ui/tui/start-tui.ts | 14 +------------- 2 files changed, 2 insertions(+), 19 deletions(-) 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 }; }