diff options
| author | Allen Hutchison <[email protected]> | 2025-04-18 14:39:05 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-18 14:39:05 -0700 |
| commit | dfae3f62848f0c8c175f0e992a479c3bf49e50ed (patch) | |
| tree | 917ee82ed364c1b03d72b62c73fdc71ed9bc3aba | |
| parent | 52683dafc360c431874d85ee9e516c13c96f055f (diff) | |
Iterm refactor (#33)
* Add a warning about the flickering in iTerm.
* Move the iterm warning out of App.tsx.
| -rw-r--r-- | packages/cli/src/ui/App.tsx | 2 | ||||
| -rw-r--r-- | packages/cli/src/ui/utils/itermDetection.tsx | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index 25cc21c4..b17ab9d8 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -14,6 +14,7 @@ import InputPrompt from './components/InputPrompt.js'; import Footer from './components/Footer.js'; import { StreamingState } from '../core/gemini-stream.js'; import { PartListUnion } from '@google/genai'; +import ITermDetectionWarning from './utils/itermDetection.js'; import { useStartupWarnings, useInitializationErrorEffect, @@ -133,6 +134,7 @@ const App = ({ directory }: AppProps) => { )} <Footer queryLength={query.length} /> + <ITermDetectionWarning /> </Box> ); }; diff --git a/packages/cli/src/ui/utils/itermDetection.tsx b/packages/cli/src/ui/utils/itermDetection.tsx new file mode 100644 index 00000000..9a847724 --- /dev/null +++ b/packages/cli/src/ui/utils/itermDetection.tsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { Box, Text } from 'ink'; + +const ITermDetectionWarning: React.FC = () => { + if (process.env.TERM_PROGRAM !== 'iTerm.app') { + return null; // Don't render anything if not in iTerm + } + + return ( + <Box marginTop={1}> + <Text dimColor>Note: Flickering may occur in iTerm.</Text> + </Box> + ); +}; + +export default ITermDetectionWarning; |
