mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-16 17:11:04 -07:00
fix(cli): replace hardcoded keybinding strings with dynamic formatters (#21159)
This commit is contained in:
committed by
GitHub
parent
f20e45175e
commit
1c3c7a343f
@@ -37,6 +37,7 @@ import {
|
||||
import type { Key } from '../hooks/useKeypress.js';
|
||||
import { useKeypress } from '../hooks/useKeypress.js';
|
||||
import { keyMatchers, Command } from '../keyMatchers.js';
|
||||
import { formatCommand } from '../utils/keybindingUtils.js';
|
||||
import type { CommandContext, SlashCommand } from '../commands/types.js';
|
||||
import type { Config } from '@google/gemini-cli-core';
|
||||
import { ApprovalMode, coreEvents, debugLogger } from '@google/gemini-cli-core';
|
||||
@@ -494,7 +495,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
buffer.insert(textToInsert, { paste: true });
|
||||
if (isLargePaste(textToInsert)) {
|
||||
appEvents.emit(AppEvent.TransientMessage, {
|
||||
message: 'Press Ctrl+O to expand pasted text',
|
||||
message: `Press ${formatCommand(Command.EXPAND_PASTE)} to expand pasted text`,
|
||||
type: TransientMessageType.Hint,
|
||||
});
|
||||
}
|
||||
@@ -730,7 +731,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
buffer.handleInput(key);
|
||||
if (key.sequence && isLargePaste(key.sequence)) {
|
||||
appEvents.emit(AppEvent.TransientMessage, {
|
||||
message: 'Press Ctrl+O to expand pasted text',
|
||||
message: `Press ${formatCommand(Command.EXPAND_PASTE)} to expand pasted text`,
|
||||
type: TransientMessageType.Hint,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
} from '../../utils/textUtils.js';
|
||||
import { useKeypress, type Key } from '../../hooks/useKeypress.js';
|
||||
import { keyMatchers, Command } from '../../keyMatchers.js';
|
||||
import { formatCommand } from '../../utils/keybindingUtils.js';
|
||||
|
||||
/**
|
||||
* Represents a single item in the settings dialog.
|
||||
@@ -625,7 +626,7 @@ export function BaseSettingsDialog({
|
||||
{/* Help text */}
|
||||
<Box marginX={1}>
|
||||
<Text color={theme.text.secondary}>
|
||||
(Use Enter to select, Ctrl+L to reset
|
||||
(Use Enter to select, {formatCommand(Command.CLEAR_SCREEN)} to reset
|
||||
{showScopeSelector ? ', Tab to change focus' : ''}, Esc to close)
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user