mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-31 00:11:11 -07:00
refactor(cli): rename 'return' key to 'enter' internally (#21796)
This commit is contained in:
committed by
GitHub
parent
ec7773eb7b
commit
14412c3a72
@@ -210,7 +210,7 @@ export const ConfigExtensionDialog: React.FC<ConfigExtensionDialogProps> = ({
|
||||
useKeypress(
|
||||
(key: Key) => {
|
||||
if (state.type === 'ASK_CONFIRMATION') {
|
||||
if (key.name === 'y' || key.name === 'return') {
|
||||
if (key.name === 'y' || key.name === 'enter') {
|
||||
state.resolve(true);
|
||||
return true;
|
||||
}
|
||||
@@ -220,7 +220,7 @@ export const ConfigExtensionDialog: React.FC<ConfigExtensionDialogProps> = ({
|
||||
}
|
||||
}
|
||||
if (state.type === 'DONE' || state.type === 'ERROR') {
|
||||
if (key.name === 'return' || key.name === 'escape') {
|
||||
if (key.name === 'enter' || key.name === 'escape') {
|
||||
onClose();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -972,7 +972,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
if (targetIndex < completion.suggestions.length) {
|
||||
const suggestion = completion.suggestions[targetIndex];
|
||||
|
||||
const isEnterKey = key.name === 'return' && !key.ctrl;
|
||||
const isEnterKey = key.name === 'enter' && !key.ctrl;
|
||||
|
||||
if (isEnterKey && shellModeActive) {
|
||||
if (hasUserNavigatedSuggestions.current) {
|
||||
|
||||
@@ -324,7 +324,7 @@ describe('SessionBrowser component', () => {
|
||||
await waitUntilReady();
|
||||
|
||||
// Press Enter.
|
||||
triggerKey({ name: 'return', sequence: '\r' });
|
||||
triggerKey({ name: 'enter', sequence: '\r' });
|
||||
await waitUntilReady();
|
||||
|
||||
expect(onResumeSession).toHaveBeenCalledTimes(1);
|
||||
@@ -367,7 +367,7 @@ describe('SessionBrowser component', () => {
|
||||
await waitUntilReady();
|
||||
|
||||
// Active selection is at 0 (current session).
|
||||
triggerKey({ name: 'return', sequence: '\r' });
|
||||
triggerKey({ name: 'enter', sequence: '\r' });
|
||||
await waitUntilReady();
|
||||
expect(onResumeSession).not.toHaveBeenCalled();
|
||||
|
||||
|
||||
@@ -873,7 +873,7 @@ export const useSessionBrowserInput = (
|
||||
|
||||
// Handling regardless of search mode.
|
||||
if (
|
||||
key.name === 'return' &&
|
||||
key.name === 'enter' &&
|
||||
state.filteredAndSortedSessions[state.activeIndex]
|
||||
) {
|
||||
const selectedSession =
|
||||
|
||||
@@ -287,7 +287,7 @@ describe('TextInput', () => {
|
||||
|
||||
await act(async () => {
|
||||
keypressHandler({
|
||||
name: 'return',
|
||||
name: 'enter',
|
||||
shift: false,
|
||||
alt: false,
|
||||
ctrl: false,
|
||||
@@ -314,7 +314,7 @@ describe('TextInput', () => {
|
||||
|
||||
await act(async () => {
|
||||
keypressHandler({
|
||||
name: 'return',
|
||||
name: 'enter',
|
||||
shift: false,
|
||||
alt: false,
|
||||
ctrl: false,
|
||||
@@ -339,7 +339,7 @@ describe('TextInput', () => {
|
||||
|
||||
await act(async () => {
|
||||
keypressHandler({
|
||||
name: 'return',
|
||||
name: 'enter',
|
||||
shift: false,
|
||||
alt: false,
|
||||
ctrl: false,
|
||||
|
||||
@@ -1533,7 +1533,7 @@ describe('useTextBuffer', () => {
|
||||
const { result } = renderHook(() => useTextBuffer({ viewport }));
|
||||
act(() => {
|
||||
result.current.handleInput({
|
||||
name: 'return',
|
||||
name: 'enter',
|
||||
shift: false,
|
||||
alt: false,
|
||||
ctrl: false,
|
||||
@@ -1789,7 +1789,7 @@ describe('useTextBuffer', () => {
|
||||
const { result } = renderHook(() => useTextBuffer({ viewport }));
|
||||
act(() => {
|
||||
result.current.handleInput({
|
||||
name: 'return',
|
||||
name: 'enter',
|
||||
shift: true,
|
||||
alt: false,
|
||||
ctrl: false,
|
||||
@@ -2290,7 +2290,7 @@ Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots
|
||||
);
|
||||
act(() => {
|
||||
result.current.handleInput({
|
||||
name: 'return',
|
||||
name: 'enter',
|
||||
shift: false,
|
||||
alt: false,
|
||||
ctrl: false,
|
||||
|
||||
Reference in New Issue
Block a user