diff options
| author | Juliette Love <[email protected]> | 2025-04-20 21:13:32 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-20 21:13:32 +0100 |
| commit | 8180ed9a687daff1720a6b1ee5a558e9d0a824e5 (patch) | |
| tree | ca45912bd8c584a8cd5529ebe8fe69cf3d41a033 /packages/cli | |
| parent | d6556c5246adeb73b8de97c6761194d787f35372 (diff) | |
Add terminal clear (#69)
Diffstat (limited to 'packages/cli')
| -rw-r--r-- | packages/cli/src/ui/hooks/useGeminiStream.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts index 1cd9f5d6..6e3e8e84 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.ts +++ b/packages/cli/src/ui/hooks/useGeminiStream.ts @@ -108,7 +108,13 @@ export const useGeminiStream = ( if (typeof query === 'string') { setDebugMessage(`User query: ${query}`); const maybeCommand = query.split(/\s+/)[0]; - if (config.getPassthroughCommands().includes(maybeCommand)) { + if (query.trim() === 'clear') { + // This just clears the *UI* history, not the model history. + // TODO: add a slash command for that. + setDebugMessage('Clearing terminal.'); + setHistory((prevHistory) => []); + return; + } else if (config.getPassthroughCommands().includes(maybeCommand)) { // Execute and capture output setDebugMessage(`Executing shell command directly: ${query}`); _exec(query, (error, stdout, stderr) => { |
