mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-01 08:51:11 -07:00
Stop printing garbage characters for F1,F2.. keys (#12835)
This commit is contained in:
committed by
GitHub
parent
2136598e87
commit
3c9052a751
@@ -17,6 +17,7 @@ import {
|
||||
stripUnsafeCharacters,
|
||||
getCachedStringWidth,
|
||||
} from '../../utils/textUtils.js';
|
||||
import type { Key } from '../../contexts/KeypressContext.js';
|
||||
import type { VimAction } from './vim-buffer-actions.js';
|
||||
import { handleVimAction } from './vim-buffer-actions.js';
|
||||
|
||||
@@ -1907,14 +1908,7 @@ export function useTextBuffer({
|
||||
);
|
||||
|
||||
const handleInput = useCallback(
|
||||
(key: {
|
||||
name: string;
|
||||
ctrl: boolean;
|
||||
meta: boolean;
|
||||
shift: boolean;
|
||||
paste: boolean;
|
||||
sequence: string;
|
||||
}): void => {
|
||||
(key: Key): void => {
|
||||
const { sequence: input } = key;
|
||||
|
||||
if (key.paste) {
|
||||
@@ -1964,7 +1958,7 @@ export function useTextBuffer({
|
||||
else if (key.name === 'delete' || (key.ctrl && key.name === 'd')) del();
|
||||
else if (key.ctrl && !key.shift && key.name === 'z') undo();
|
||||
else if (key.ctrl && key.shift && key.name === 'z') redo();
|
||||
else if (input && !key.ctrl && !key.meta && key.name !== 'tab') {
|
||||
else if (key.insertable) {
|
||||
insert(input, { paste: key.paste });
|
||||
}
|
||||
},
|
||||
@@ -2266,14 +2260,7 @@ export interface TextBuffer {
|
||||
/**
|
||||
* High level "handleInput" – receives what Ink gives us.
|
||||
*/
|
||||
handleInput: (key: {
|
||||
name: string;
|
||||
ctrl: boolean;
|
||||
meta: boolean;
|
||||
shift: boolean;
|
||||
paste: boolean;
|
||||
sequence: string;
|
||||
}) => void;
|
||||
handleInput: (key: Key) => void;
|
||||
/**
|
||||
* Opens the current buffer contents in the user's preferred terminal text
|
||||
* editor ($VISUAL or $EDITOR, falling back to "vi"). The method blocks
|
||||
|
||||
Reference in New Issue
Block a user