diff options
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/slashCommandProcessor.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts index b4ce0d4d..32f55de2 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts @@ -57,6 +57,11 @@ export const useSlashCommandProcessor = ( ) => { const session = useSessionStats(); const [commands, setCommands] = useState<readonly SlashCommand[]>([]); + const [reloadTrigger, setReloadTrigger] = useState(0); + + const reloadCommands = useCallback(() => { + setReloadTrigger((v) => v + 1); + }, []); const [shellConfirmationRequest, setShellConfirmationRequest] = useState<null | { commands: string[]; @@ -172,6 +177,7 @@ export const useSlashCommandProcessor = ( toggleCorgiMode, toggleVimEnabled, setGeminiMdFileCount, + reloadCommands, }, session: { stats: session.stats, @@ -195,6 +201,7 @@ export const useSlashCommandProcessor = ( toggleVimEnabled, sessionShellAllowlist, setGeminiMdFileCount, + reloadCommands, ], ); @@ -220,7 +227,7 @@ export const useSlashCommandProcessor = ( return () => { controller.abort(); }; - }, [config, ideMode]); + }, [config, ideMode, reloadTrigger]); const handleSlashCommand = useCallback( async ( |
