summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/App.tsx
diff options
context:
space:
mode:
authorAbhi <[email protected]>2025-07-07 16:45:44 -0400
committerGitHub <[email protected]>2025-07-07 20:45:44 +0000
commitaa10ccba713d49bef6bf474bfd72c0852e3da611 (patch)
tree92f1de8bec31cdb10a02fe8ddac1fbde41b75e7f /packages/cli/src/ui/App.tsx
parent6eccb474c77e41aa88d1d1d4ea7eada3e85e746c (diff)
feature(commands) - Refactor Slash Command + Vision For the Future (#3175)
Diffstat (limited to 'packages/cli/src/ui/App.tsx')
-rw-r--r--packages/cli/src/ui/App.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx
index 98d6a150..feb132ae 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -265,6 +265,7 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
handleSlashCommand,
slashCommands,
pendingHistoryItems: pendingSlashCommandHistoryItems,
+ commandContext,
} = useSlashCommandProcessor(
config,
settings,
@@ -278,7 +279,6 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
openThemeDialog,
openAuthDialog,
openEditorDialog,
- performMemoryRefresh,
toggleCorgiMode,
showToolDescriptions,
setQuittingMessages,
@@ -326,9 +326,10 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
const quitCommand = slashCommands.find(
(cmd) => cmd.name === 'quit' || cmd.altName === 'exit',
);
- if (quitCommand) {
- quitCommand.action('quit', '', '');
+ if (quitCommand && quitCommand.action) {
+ quitCommand.action(commandContext, '');
} else {
+ // This is unlikely to be needed but added for an additional fallback.
process.exit(0);
}
} else {
@@ -339,7 +340,8 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
}, CTRL_EXIT_PROMPT_DURATION_MS);
}
},
- [slashCommands],
+ // Add commandContext to the dependency array here!
+ [slashCommands, commandContext],
);
useInput((input: string, key: InkKeyType) => {
@@ -775,6 +777,7 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
onClearScreen={handleClearScreen}
config={config}
slashCommands={slashCommands}
+ commandContext={commandContext}
shellModeActive={shellModeActive}
setShellModeActive={setShellModeActive}
/>