Iterm refactor (#33)

* Add a warning about the flickering in iTerm.

* Move the iterm warning out of App.tsx.
This commit is contained in:
Allen Hutchison 2025-04-18 14:39:05 -07:00 committed by GitHub
parent 52683dafc3
commit dfae3f6284
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -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>
);
};

View File

@ -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;