mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 19:44:30 -07:00
Support ink scrolling final pr (#12567)
This commit is contained in:
@@ -78,11 +78,7 @@ import { useTextBuffer } from './components/shared/text-buffer.js';
|
||||
import { useLogger } from './hooks/useLogger.js';
|
||||
import { useGeminiStream } from './hooks/useGeminiStream.js';
|
||||
import { useVim } from './hooks/vim.js';
|
||||
import {
|
||||
type LoadableSettingScope,
|
||||
type LoadedSettings,
|
||||
SettingScope,
|
||||
} from '../config/settings.js';
|
||||
import { type LoadableSettingScope, SettingScope } from '../config/settings.js';
|
||||
import { type InitializationResult } from '../core/initializer.js';
|
||||
import { useFocus } from './hooks/useFocus.js';
|
||||
import { useBracketedPaste } from './hooks/useBracketedPaste.js';
|
||||
@@ -110,6 +106,8 @@ import { useSessionResume } from './hooks/useSessionResume.js';
|
||||
import { type ExtensionManager } from '../config/extension-manager.js';
|
||||
import { requestConsentInteractive } from '../config/extensions/consent.js';
|
||||
import { disableMouseEvents, enableMouseEvents } from './utils/mouse.js';
|
||||
import { useAlternateBuffer } from './hooks/useAlternateBuffer.js';
|
||||
import { useSettings } from './contexts/SettingsContext.js';
|
||||
|
||||
const CTRL_EXIT_PROMPT_DURATION_MS = 1000;
|
||||
const QUEUE_ERROR_DISPLAY_DURATION_MS = 3000;
|
||||
@@ -127,7 +125,6 @@ function isToolExecuting(pendingHistoryItems: HistoryItemWithoutId[]) {
|
||||
|
||||
interface AppContainerProps {
|
||||
config: Config;
|
||||
settings: LoadedSettings;
|
||||
startupWarnings?: string[];
|
||||
version: string;
|
||||
initializationResult: InitializationResult;
|
||||
@@ -147,9 +144,11 @@ const SHELL_WIDTH_FRACTION = 0.89;
|
||||
const SHELL_HEIGHT_PADDING = 10;
|
||||
|
||||
export const AppContainer = (props: AppContainerProps) => {
|
||||
const { settings, config, initializationResult, resumedSessionData } = props;
|
||||
const { config, initializationResult, resumedSessionData } = props;
|
||||
const historyManager = useHistory();
|
||||
useMemoryMonitor(historyManager);
|
||||
const settings = useSettings();
|
||||
const isAlternateBuffer = useAlternateBuffer();
|
||||
const [corgiMode, setCorgiMode] = useState(false);
|
||||
const [debugMessage, setDebugMessage] = useState<string>('');
|
||||
const [quittingMessages, setQuittingMessages] = useState<
|
||||
@@ -359,11 +358,11 @@ export const AppContainer = (props: AppContainerProps) => {
|
||||
}, [historyManager.history, logger]);
|
||||
|
||||
const refreshStatic = useCallback(() => {
|
||||
if (settings.merged.ui?.useAlternateBuffer === false) {
|
||||
if (!isAlternateBuffer) {
|
||||
stdout.write(ansiEscapes.clearTerminal);
|
||||
}
|
||||
setHistoryRemountKey((prev) => prev + 1);
|
||||
}, [setHistoryRemountKey, stdout, settings]);
|
||||
}, [setHistoryRemountKey, stdout, isAlternateBuffer]);
|
||||
|
||||
const {
|
||||
isThemeDialogOpen,
|
||||
@@ -1036,10 +1035,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
debugLogger.log('[DEBUG] Keystroke:', JSON.stringify(key));
|
||||
}
|
||||
|
||||
if (
|
||||
settings.merged.ui?.useAlternateBuffer &&
|
||||
keyMatchers[Command.TOGGLE_COPY_MODE](key)
|
||||
) {
|
||||
if (isAlternateBuffer && keyMatchers[Command.TOGGLE_COPY_MODE](key)) {
|
||||
setCopyModeEnabled(true);
|
||||
disableMouseEvents();
|
||||
return;
|
||||
@@ -1111,7 +1107,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
|
||||
refreshStatic,
|
||||
setCopyModeEnabled,
|
||||
copyModeEnabled,
|
||||
settings.merged.ui?.useAlternateBuffer,
|
||||
isAlternateBuffer,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user