mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
make command names consistent (#21907)
This commit is contained in:
committed by
GitHub
parent
0d60d68cf9
commit
077c1a1e2d
@@ -106,20 +106,25 @@ available combinations.
|
|||||||
| Cycle through approval modes: default (prompt), auto_edit (auto-approve edits), and plan (read-only). Plan mode is skipped when the agent is busy. | `Shift+Tab` |
|
| Cycle through approval modes: default (prompt), auto_edit (auto-approve edits), and plan (read-only). Plan mode is skipped when the agent is busy. | `Shift+Tab` |
|
||||||
| Expand and collapse blocks of content when not in alternate buffer mode. | `Ctrl+O` |
|
| Expand and collapse blocks of content when not in alternate buffer mode. | `Ctrl+O` |
|
||||||
| Expand or collapse a paste placeholder when cursor is over placeholder. | `Ctrl+O` |
|
| Expand or collapse a paste placeholder when cursor is over placeholder. | `Ctrl+O` |
|
||||||
| Toggle current background shell visibility. | `Ctrl+B` |
|
|
||||||
| Toggle background shell list. | `Ctrl+L` |
|
|
||||||
| Kill the active background shell. | `Ctrl+K` |
|
|
||||||
| Confirm selection in background shell list. | `Enter` |
|
|
||||||
| Dismiss background shell list. | `Esc` |
|
|
||||||
| Move focus from background shell to Gemini. | `Shift+Tab` |
|
|
||||||
| Move focus from background shell list to Gemini. | `Tab` |
|
|
||||||
| Show warning when trying to move focus away from background shell. | `Tab` |
|
|
||||||
| Show warning when trying to move focus away from shell input. | `Tab` |
|
|
||||||
| Move focus from Gemini to the active shell. | `Tab` |
|
| Move focus from Gemini to the active shell. | `Tab` |
|
||||||
| Move focus from the shell back to Gemini. | `Shift+Tab` |
|
| Move focus from the shell back to Gemini. | `Shift+Tab` |
|
||||||
| Clear the terminal screen and redraw the UI. | `Ctrl+L` |
|
| Clear the terminal screen and redraw the UI. | `Ctrl+L` |
|
||||||
| Restart the application. | `R`<br />`Shift+R` |
|
| Restart the application. | `R`<br />`Shift+R` |
|
||||||
| Suspend the CLI and move it to the background. | `Ctrl+Z` |
|
| Suspend the CLI and move it to the background. | `Ctrl+Z` |
|
||||||
|
| Show warning when trying to move focus away from shell input. | `Tab` |
|
||||||
|
|
||||||
|
#### Background Shell Controls
|
||||||
|
|
||||||
|
| Action | Keys |
|
||||||
|
| ------------------------------------------------------------------ | ----------- |
|
||||||
|
| Dismiss background shell list. | `Esc` |
|
||||||
|
| Confirm selection in background shell list. | `Enter` |
|
||||||
|
| Toggle current background shell visibility. | `Ctrl+B` |
|
||||||
|
| Toggle background shell list. | `Ctrl+L` |
|
||||||
|
| Kill the active background shell. | `Ctrl+K` |
|
||||||
|
| Move focus from background shell to Gemini. | `Shift+Tab` |
|
||||||
|
| Move focus from background shell list to Gemini. | `Tab` |
|
||||||
|
| Show warning when trying to move focus away from background shell. | `Tab` |
|
||||||
|
|
||||||
<!-- KEYBINDINGS-AUTOGEN:END -->
|
<!-- KEYBINDINGS-AUTOGEN:END -->
|
||||||
|
|
||||||
|
|||||||
@@ -73,16 +73,6 @@ export enum Command {
|
|||||||
OPEN_EXTERNAL_EDITOR = 'input.openExternalEditor',
|
OPEN_EXTERNAL_EDITOR = 'input.openExternalEditor',
|
||||||
PASTE_CLIPBOARD = 'input.paste',
|
PASTE_CLIPBOARD = 'input.paste',
|
||||||
|
|
||||||
BACKGROUND_SHELL_ESCAPE = 'backgroundShellEscape',
|
|
||||||
BACKGROUND_SHELL_SELECT = 'backgroundShellSelect',
|
|
||||||
TOGGLE_BACKGROUND_SHELL = 'toggleBackgroundShell',
|
|
||||||
TOGGLE_BACKGROUND_SHELL_LIST = 'toggleBackgroundShellList',
|
|
||||||
KILL_BACKGROUND_SHELL = 'backgroundShell.kill',
|
|
||||||
UNFOCUS_BACKGROUND_SHELL = 'backgroundShell.unfocus',
|
|
||||||
UNFOCUS_BACKGROUND_SHELL_LIST = 'backgroundShell.listUnfocus',
|
|
||||||
SHOW_BACKGROUND_SHELL_UNFOCUS_WARNING = 'backgroundShell.unfocusWarning',
|
|
||||||
SHOW_SHELL_INPUT_UNFOCUS_WARNING = 'shellInput.unfocusWarning',
|
|
||||||
|
|
||||||
// App Controls
|
// App Controls
|
||||||
SHOW_ERROR_DETAILS = 'app.showErrorDetails',
|
SHOW_ERROR_DETAILS = 'app.showErrorDetails',
|
||||||
SHOW_FULL_TODOS = 'app.showFullTodos',
|
SHOW_FULL_TODOS = 'app.showFullTodos',
|
||||||
@@ -98,6 +88,17 @@ export enum Command {
|
|||||||
CLEAR_SCREEN = 'app.clearScreen',
|
CLEAR_SCREEN = 'app.clearScreen',
|
||||||
RESTART_APP = 'app.restart',
|
RESTART_APP = 'app.restart',
|
||||||
SUSPEND_APP = 'app.suspend',
|
SUSPEND_APP = 'app.suspend',
|
||||||
|
SHOW_SHELL_INPUT_UNFOCUS_WARNING = 'app.showShellUnfocusWarning',
|
||||||
|
|
||||||
|
// Background Shell Controls
|
||||||
|
BACKGROUND_SHELL_ESCAPE = 'background.escape',
|
||||||
|
BACKGROUND_SHELL_SELECT = 'background.select',
|
||||||
|
TOGGLE_BACKGROUND_SHELL = 'background.toggle',
|
||||||
|
TOGGLE_BACKGROUND_SHELL_LIST = 'background.toggleList',
|
||||||
|
KILL_BACKGROUND_SHELL = 'background.kill',
|
||||||
|
UNFOCUS_BACKGROUND_SHELL = 'background.unfocus',
|
||||||
|
UNFOCUS_BACKGROUND_SHELL_LIST = 'background.unfocusList',
|
||||||
|
SHOW_BACKGROUND_SHELL_UNFOCUS_WARNING = 'background.unfocusWarning',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -105,20 +106,10 @@ export enum Command {
|
|||||||
*/
|
*/
|
||||||
export class KeyBinding {
|
export class KeyBinding {
|
||||||
private static readonly VALID_KEYS = new Set([
|
private static readonly VALID_KEYS = new Set([
|
||||||
// Letters & Numbers
|
...'abcdefghijklmnopqrstuvwxyz0123456789', // Letters & Numbers
|
||||||
...'abcdefghijklmnopqrstuvwxyz0123456789',
|
..."`-=[]\\;',./", // Punctuation
|
||||||
// Punctuation
|
...Array.from({ length: 19 }, (_, i) => `f${i + 1}`), // Function Keys
|
||||||
'`',
|
...Array.from({ length: 10 }, (_, i) => `numpad${i}`), // Numpad Numbers
|
||||||
'-',
|
|
||||||
'=',
|
|
||||||
'[',
|
|
||||||
']',
|
|
||||||
'\\',
|
|
||||||
';',
|
|
||||||
"'",
|
|
||||||
',',
|
|
||||||
'.',
|
|
||||||
'/',
|
|
||||||
// Navigation & Actions
|
// Navigation & Actions
|
||||||
'left',
|
'left',
|
||||||
'up',
|
'up',
|
||||||
@@ -139,10 +130,6 @@ export class KeyBinding {
|
|||||||
'insert',
|
'insert',
|
||||||
'numlock',
|
'numlock',
|
||||||
'scrolllock',
|
'scrolllock',
|
||||||
// Function Keys
|
|
||||||
...Array.from({ length: 19 }, (_, i) => `f${i + 1}`),
|
|
||||||
// Numpad
|
|
||||||
...Array.from({ length: 10 }, (_, i) => `numpad${i}`),
|
|
||||||
'numpad_multiply',
|
'numpad_multiply',
|
||||||
'numpad_add',
|
'numpad_add',
|
||||||
'numpad_separator',
|
'numpad_separator',
|
||||||
@@ -354,15 +341,6 @@ export const defaultKeyBindings: KeyBindingConfig = {
|
|||||||
[Command.TOGGLE_COPY_MODE]: [new KeyBinding('ctrl+s')],
|
[Command.TOGGLE_COPY_MODE]: [new KeyBinding('ctrl+s')],
|
||||||
[Command.TOGGLE_YOLO]: [new KeyBinding('ctrl+y')],
|
[Command.TOGGLE_YOLO]: [new KeyBinding('ctrl+y')],
|
||||||
[Command.CYCLE_APPROVAL_MODE]: [new KeyBinding('shift+tab')],
|
[Command.CYCLE_APPROVAL_MODE]: [new KeyBinding('shift+tab')],
|
||||||
[Command.TOGGLE_BACKGROUND_SHELL]: [new KeyBinding('ctrl+b')],
|
|
||||||
[Command.TOGGLE_BACKGROUND_SHELL_LIST]: [new KeyBinding('ctrl+l')],
|
|
||||||
[Command.KILL_BACKGROUND_SHELL]: [new KeyBinding('ctrl+k')],
|
|
||||||
[Command.UNFOCUS_BACKGROUND_SHELL]: [new KeyBinding('shift+tab')],
|
|
||||||
[Command.UNFOCUS_BACKGROUND_SHELL_LIST]: [new KeyBinding('tab')],
|
|
||||||
[Command.SHOW_BACKGROUND_SHELL_UNFOCUS_WARNING]: [new KeyBinding('tab')],
|
|
||||||
[Command.SHOW_SHELL_INPUT_UNFOCUS_WARNING]: [new KeyBinding('tab')],
|
|
||||||
[Command.BACKGROUND_SHELL_SELECT]: [new KeyBinding('enter')],
|
|
||||||
[Command.BACKGROUND_SHELL_ESCAPE]: [new KeyBinding('escape')],
|
|
||||||
[Command.SHOW_MORE_LINES]: [new KeyBinding('ctrl+o')],
|
[Command.SHOW_MORE_LINES]: [new KeyBinding('ctrl+o')],
|
||||||
[Command.EXPAND_PASTE]: [new KeyBinding('ctrl+o')],
|
[Command.EXPAND_PASTE]: [new KeyBinding('ctrl+o')],
|
||||||
[Command.FOCUS_SHELL_INPUT]: [new KeyBinding('tab')],
|
[Command.FOCUS_SHELL_INPUT]: [new KeyBinding('tab')],
|
||||||
@@ -370,6 +348,17 @@ export const defaultKeyBindings: KeyBindingConfig = {
|
|||||||
[Command.CLEAR_SCREEN]: [new KeyBinding('ctrl+l')],
|
[Command.CLEAR_SCREEN]: [new KeyBinding('ctrl+l')],
|
||||||
[Command.RESTART_APP]: [new KeyBinding('r'), new KeyBinding('shift+r')],
|
[Command.RESTART_APP]: [new KeyBinding('r'), new KeyBinding('shift+r')],
|
||||||
[Command.SUSPEND_APP]: [new KeyBinding('ctrl+z')],
|
[Command.SUSPEND_APP]: [new KeyBinding('ctrl+z')],
|
||||||
|
[Command.SHOW_SHELL_INPUT_UNFOCUS_WARNING]: [new KeyBinding('tab')],
|
||||||
|
|
||||||
|
// Background Shell Controls
|
||||||
|
[Command.BACKGROUND_SHELL_ESCAPE]: [new KeyBinding('escape')],
|
||||||
|
[Command.BACKGROUND_SHELL_SELECT]: [new KeyBinding('enter')],
|
||||||
|
[Command.TOGGLE_BACKGROUND_SHELL]: [new KeyBinding('ctrl+b')],
|
||||||
|
[Command.TOGGLE_BACKGROUND_SHELL_LIST]: [new KeyBinding('ctrl+l')],
|
||||||
|
[Command.KILL_BACKGROUND_SHELL]: [new KeyBinding('ctrl+k')],
|
||||||
|
[Command.UNFOCUS_BACKGROUND_SHELL]: [new KeyBinding('shift+tab')],
|
||||||
|
[Command.UNFOCUS_BACKGROUND_SHELL_LIST]: [new KeyBinding('tab')],
|
||||||
|
[Command.SHOW_BACKGROUND_SHELL_UNFOCUS_WARNING]: [new KeyBinding('tab')],
|
||||||
};
|
};
|
||||||
|
|
||||||
interface CommandCategory {
|
interface CommandCategory {
|
||||||
@@ -475,20 +464,25 @@ export const commandCategories: readonly CommandCategory[] = [
|
|||||||
Command.CYCLE_APPROVAL_MODE,
|
Command.CYCLE_APPROVAL_MODE,
|
||||||
Command.SHOW_MORE_LINES,
|
Command.SHOW_MORE_LINES,
|
||||||
Command.EXPAND_PASTE,
|
Command.EXPAND_PASTE,
|
||||||
Command.TOGGLE_BACKGROUND_SHELL,
|
|
||||||
Command.TOGGLE_BACKGROUND_SHELL_LIST,
|
|
||||||
Command.KILL_BACKGROUND_SHELL,
|
|
||||||
Command.BACKGROUND_SHELL_SELECT,
|
|
||||||
Command.BACKGROUND_SHELL_ESCAPE,
|
|
||||||
Command.UNFOCUS_BACKGROUND_SHELL,
|
|
||||||
Command.UNFOCUS_BACKGROUND_SHELL_LIST,
|
|
||||||
Command.SHOW_BACKGROUND_SHELL_UNFOCUS_WARNING,
|
|
||||||
Command.SHOW_SHELL_INPUT_UNFOCUS_WARNING,
|
|
||||||
Command.FOCUS_SHELL_INPUT,
|
Command.FOCUS_SHELL_INPUT,
|
||||||
Command.UNFOCUS_SHELL_INPUT,
|
Command.UNFOCUS_SHELL_INPUT,
|
||||||
Command.CLEAR_SCREEN,
|
Command.CLEAR_SCREEN,
|
||||||
Command.RESTART_APP,
|
Command.RESTART_APP,
|
||||||
Command.SUSPEND_APP,
|
Command.SUSPEND_APP,
|
||||||
|
Command.SHOW_SHELL_INPUT_UNFOCUS_WARNING,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Background Shell Controls',
|
||||||
|
commands: [
|
||||||
|
Command.BACKGROUND_SHELL_ESCAPE,
|
||||||
|
Command.BACKGROUND_SHELL_SELECT,
|
||||||
|
Command.TOGGLE_BACKGROUND_SHELL,
|
||||||
|
Command.TOGGLE_BACKGROUND_SHELL_LIST,
|
||||||
|
Command.KILL_BACKGROUND_SHELL,
|
||||||
|
Command.UNFOCUS_BACKGROUND_SHELL,
|
||||||
|
Command.UNFOCUS_BACKGROUND_SHELL_LIST,
|
||||||
|
Command.SHOW_BACKGROUND_SHELL_UNFOCUS_WARNING,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -576,9 +570,18 @@ export const commandDescriptions: Readonly<Record<Command, string>> = {
|
|||||||
'Expand and collapse blocks of content when not in alternate buffer mode.',
|
'Expand and collapse blocks of content when not in alternate buffer mode.',
|
||||||
[Command.EXPAND_PASTE]:
|
[Command.EXPAND_PASTE]:
|
||||||
'Expand or collapse a paste placeholder when cursor is over placeholder.',
|
'Expand or collapse a paste placeholder when cursor is over placeholder.',
|
||||||
|
[Command.FOCUS_SHELL_INPUT]: 'Move focus from Gemini to the active shell.',
|
||||||
|
[Command.UNFOCUS_SHELL_INPUT]: 'Move focus from the shell back to Gemini.',
|
||||||
|
[Command.CLEAR_SCREEN]: 'Clear the terminal screen and redraw the UI.',
|
||||||
|
[Command.RESTART_APP]: 'Restart the application.',
|
||||||
|
[Command.SUSPEND_APP]: 'Suspend the CLI and move it to the background.',
|
||||||
|
[Command.SHOW_SHELL_INPUT_UNFOCUS_WARNING]:
|
||||||
|
'Show warning when trying to move focus away from shell input.',
|
||||||
|
|
||||||
|
// Background Shell Controls
|
||||||
|
[Command.BACKGROUND_SHELL_ESCAPE]: 'Dismiss background shell list.',
|
||||||
[Command.BACKGROUND_SHELL_SELECT]:
|
[Command.BACKGROUND_SHELL_SELECT]:
|
||||||
'Confirm selection in background shell list.',
|
'Confirm selection in background shell list.',
|
||||||
[Command.BACKGROUND_SHELL_ESCAPE]: 'Dismiss background shell list.',
|
|
||||||
[Command.TOGGLE_BACKGROUND_SHELL]:
|
[Command.TOGGLE_BACKGROUND_SHELL]:
|
||||||
'Toggle current background shell visibility.',
|
'Toggle current background shell visibility.',
|
||||||
[Command.TOGGLE_BACKGROUND_SHELL_LIST]: 'Toggle background shell list.',
|
[Command.TOGGLE_BACKGROUND_SHELL_LIST]: 'Toggle background shell list.',
|
||||||
@@ -589,11 +592,4 @@ export const commandDescriptions: Readonly<Record<Command, string>> = {
|
|||||||
'Move focus from background shell list to Gemini.',
|
'Move focus from background shell list to Gemini.',
|
||||||
[Command.SHOW_BACKGROUND_SHELL_UNFOCUS_WARNING]:
|
[Command.SHOW_BACKGROUND_SHELL_UNFOCUS_WARNING]:
|
||||||
'Show warning when trying to move focus away from background shell.',
|
'Show warning when trying to move focus away from background shell.',
|
||||||
[Command.SHOW_SHELL_INPUT_UNFOCUS_WARNING]:
|
|
||||||
'Show warning when trying to move focus away from shell input.',
|
|
||||||
[Command.FOCUS_SHELL_INPUT]: 'Move focus from Gemini to the active shell.',
|
|
||||||
[Command.UNFOCUS_SHELL_INPUT]: 'Move focus from the shell back to Gemini.',
|
|
||||||
[Command.CLEAR_SCREEN]: 'Clear the terminal screen and redraw the UI.',
|
|
||||||
[Command.RESTART_APP]: 'Restart the application.',
|
|
||||||
[Command.SUSPEND_APP]: 'Suspend the CLI and move it to the background.',
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user