feat(cli): update undo/redo keybindings to Cmd+Z/Alt+Z and Shift+Cmd+Z/Shift+Alt+Z (#17800)

This commit is contained in:
Tommaso Sciortino
2026-01-28 14:57:27 -08:00
committed by GitHub
parent b2265cfde4
commit 553ae3ad69
11 changed files with 96 additions and 47 deletions
+13 -2
View File
@@ -85,6 +85,7 @@ export enum Command {
UNFOCUS_SHELL_INPUT = 'app.unfocusShellInput',
CLEAR_SCREEN = 'app.clearScreen',
RESTART_APP = 'app.restart',
SUSPEND_APP = 'app.suspend',
}
/**
@@ -170,8 +171,15 @@ export const defaultKeyBindings: KeyBindingConfig = {
],
[Command.DELETE_CHAR_LEFT]: [{ key: 'backspace' }, { key: 'h', ctrl: true }],
[Command.DELETE_CHAR_RIGHT]: [{ key: 'delete' }, { key: 'd', ctrl: true }],
[Command.UNDO]: [{ key: 'z', shift: false, ctrl: true }],
[Command.REDO]: [{ key: 'z', shift: true, ctrl: true }],
[Command.UNDO]: [
{ key: 'z', cmd: true, shift: false },
{ key: 'z', alt: true, shift: false },
],
[Command.REDO]: [
{ key: 'z', ctrl: true, shift: true },
{ key: 'z', cmd: true, shift: true },
{ key: 'z', alt: true, shift: true },
],
// Scrolling
[Command.SCROLL_UP]: [{ key: 'up', shift: true }],
@@ -265,6 +273,7 @@ export const defaultKeyBindings: KeyBindingConfig = {
[Command.UNFOCUS_SHELL_INPUT]: [{ key: 'tab' }],
[Command.CLEAR_SCREEN]: [{ key: 'l', ctrl: true }],
[Command.RESTART_APP]: [{ key: 'r' }],
[Command.SUSPEND_APP]: [{ key: 'z', ctrl: true }],
};
interface CommandCategory {
@@ -374,6 +383,7 @@ export const commandCategories: readonly CommandCategory[] = [
Command.UNFOCUS_SHELL_INPUT,
Command.CLEAR_SCREEN,
Command.RESTART_APP,
Command.SUSPEND_APP,
],
},
];
@@ -464,4 +474,5 @@ export const commandDescriptions: Readonly<Record<Command, string>> = {
[Command.UNFOCUS_SHELL_INPUT]: 'Focus the Gemini input from the shell input.',
[Command.CLEAR_SCREEN]: 'Clear the terminal screen and redraw the UI.',
[Command.RESTART_APP]: 'Restart the application.',
[Command.SUSPEND_APP]: 'Suspend the application (not yet implemented).',
};