summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
authorAbhi <[email protected]>2025-07-17 12:07:10 -0400
committerGitHub <[email protected]>2025-07-17 16:07:10 +0000
commit79d36ac0a54c17a877264eb4d532854eb51e2e42 (patch)
treecc7720bdfab2a16cb9e19fa178d155a646f05230 /packages/cli/src
parentfc8c38b2bc8a7f462000db7d38cd801b1eade736 (diff)
(fix) - regression to quit shortcut from command migration (#4374)
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/ui/App.tsx14
1 files changed, 3 insertions, 11 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx
index 5e16b449..e2856199 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -432,15 +432,8 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
if (timerRef.current) {
clearTimeout(timerRef.current);
}
- const quitCommand = slashCommands.find(
- (cmd) => cmd.name === 'quit' || cmd.altName === 'exit',
- );
- if (quitCommand && quitCommand.action) {
- quitCommand.action(commandContext, '');
- } else {
- // This is unlikely to be needed but added for an additional fallback.
- process.exit(0);
- }
+ // Directly invoke the central command handler.
+ handleSlashCommand('/quit');
} else {
setPressedOnce(true);
timerRef.current = setTimeout(() => {
@@ -449,8 +442,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
}, CTRL_EXIT_PROMPT_DURATION_MS);
}
},
- // Add commandContext to the dependency array here!
- [slashCommands, commandContext],
+ [handleSlashCommand],
);
useInput((input: string, key: InkKeyType) => {