mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-11 11:57:03 -07:00
34 lines
977 B
TypeScript
34 lines
977 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import type React from 'react';
|
|
import { Box, Text } from 'ink';
|
|
import { useInputState } from '../contexts/InputContext.js';
|
|
import { useUIState } from '../contexts/UIStateContext.js';
|
|
import { useConfig } from '../contexts/ConfigContext.js';
|
|
import { theme } from '../semantic-colors.js';
|
|
|
|
export const CopyModeWarning: React.FC = () => {
|
|
const { copyModeEnabled } = useInputState();
|
|
const { mouseMode } = useUIState();
|
|
const config = useConfig();
|
|
const isTrueAlternateBuffer = config.getUseAlternateBuffer();
|
|
|
|
const isSelectionMode = isTrueAlternateBuffer && !mouseMode;
|
|
const showWarning = copyModeEnabled || isSelectionMode;
|
|
|
|
return (
|
|
<Box height={1}>
|
|
{showWarning && (
|
|
<Text color={theme.status.warning}>
|
|
In Copy Mode. Use Page Up/Down to scroll. Press Ctrl+S or any other
|
|
key to exit.
|
|
</Text>
|
|
)}
|
|
</Box>
|
|
);
|
|
};
|