mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Iterm refactor (#33)
* Add a warning about the flickering in iTerm. * Move the iterm warning out of App.tsx.
This commit is contained in:
@@ -14,6 +14,7 @@ import InputPrompt from './components/InputPrompt.js';
|
|||||||
import Footer from './components/Footer.js';
|
import Footer from './components/Footer.js';
|
||||||
import { StreamingState } from '../core/gemini-stream.js';
|
import { StreamingState } from '../core/gemini-stream.js';
|
||||||
import { PartListUnion } from '@google/genai';
|
import { PartListUnion } from '@google/genai';
|
||||||
|
import ITermDetectionWarning from './utils/itermDetection.js';
|
||||||
import {
|
import {
|
||||||
useStartupWarnings,
|
useStartupWarnings,
|
||||||
useInitializationErrorEffect,
|
useInitializationErrorEffect,
|
||||||
@@ -133,6 +134,7 @@ const App = ({ directory }: AppProps) => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Footer queryLength={query.length} />
|
<Footer queryLength={query.length} />
|
||||||
|
<ITermDetectionWarning />
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
16
packages/cli/src/ui/utils/itermDetection.tsx
Normal file
16
packages/cli/src/ui/utils/itermDetection.tsx
Normal 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;
|
||||||
Reference in New Issue
Block a user