summaryrefslogtreecommitdiff
path: root/packages/cli/src/gemini.tsx
diff options
context:
space:
mode:
authorDaniel Young Lee <[email protected]>2025-05-30 19:36:52 -0700
committerN. Taylor Mullen <[email protected]>2025-05-30 20:51:07 -0700
commit1468047081d330bd36e98380d6eaa8588653f78e (patch)
tree74733230f63d9b0962a97204389cde1f6b671799 /packages/cli/src/gemini.tsx
parent7012c86336effa2f9c4a900edf06e8b4e5cc4cbb (diff)
feat: Implement delayed Ctrl+C exit prompt
This change introduces a small delay after the first Ctrl+C press, prompting the user to press Ctrl+C again to exit. This helps prevent accidental termination of the application. - Added `exitOnCtrlC={false}` to the Ink render options in `gemini.tsx` to enable custom Ctrl+C handling. - Implemented logic in `App.tsx` to: - Display "Press Ctrl+C again to exit." for 2 seconds after the first Ctrl+C. - Exit the application if Ctrl+C is pressed again during this period. - Revert to normal operation if the second Ctrl+C is not pressed within the timeout. - Defined a constant `CTRL_C_PROMPT_DURATION_MS` for the timeout duration.
Diffstat (limited to 'packages/cli/src/gemini.tsx')
-rw-r--r--packages/cli/src/gemini.tsx1
1 files changed, 1 insertions, 0 deletions
diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx
index e7ab6baa..0ed27a99 100644
--- a/packages/cli/src/gemini.tsx
+++ b/packages/cli/src/gemini.tsx
@@ -78,6 +78,7 @@ async function main() {
startupWarnings={startupWarnings}
/>
</React.StrictMode>,
+ { exitOnCtrlC: false },
);
return;
}