Skip to content

Commit 53c9c5e

Browse files
committed
feat(cli): support Ctrl-Z suspension
- Implement Ctrl+Z suspension with robust terminal state handling. - Rebind Undo/Redo to Alt+Z / Alt+Shift+Z to avoid conflicts. - Fix macOS Option key character mapping for Undo/Redo. - Improve type safety for app.rerender() in AppContainer. - Add comprehensive suspension test suite. - Fix environment leakage in core tests. - Update keyboard shortcut documentation. Fixes google-gemini#5018
1 parent 8cae90f commit 53c9c5e

9 files changed

Lines changed: 595 additions & 19 deletions

File tree

docs/cli/keyboard-shortcuts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ available combinations.
118118
| Focus the Gemini input from the shell input. | `Tab` |
119119
| Clear the terminal screen and redraw the UI. | `Ctrl + L` |
120120
| Restart the application. | `R` |
121-
| Suspend the application (not yet implemented). | `Ctrl + Z` |
121+
| Suspend the CLI and move it to the background. | `Ctrl + Z` |
122122

123123
<!-- KEYBINDINGS-AUTOGEN:END -->
124124

@@ -137,4 +137,4 @@ available combinations.
137137
the numbered radio option and confirm when the full number is entered.
138138
- `Double-click` on a paste placeholder (`[Pasted Text: X lines]`) in alternate
139139
buffer mode: Expand to view full content inline. Double-click again to
140-
collapse.
140+
collapse.

packages/cli/src/config/keyBindings.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export enum Command {
9494
UNFOCUS_SHELL_INPUT = 'app.unfocusShellInput',
9595
CLEAR_SCREEN = 'app.clearScreen',
9696
RESTART_APP = 'app.restart',
97-
SUSPEND_APP = 'app.suspend',
97+
SUSPEND = 'app.suspend',
9898
}
9999

100100
/**
@@ -291,7 +291,7 @@ export const defaultKeyBindings: KeyBindingConfig = {
291291
[Command.UNFOCUS_SHELL_INPUT]: [{ key: 'tab' }],
292292
[Command.CLEAR_SCREEN]: [{ key: 'l', ctrl: true }],
293293
[Command.RESTART_APP]: [{ key: 'r' }],
294-
[Command.SUSPEND_APP]: [{ key: 'z', ctrl: true }],
294+
[Command.SUSPEND]: [{ key: 'z', ctrl: true }],
295295
};
296296

297297
interface CommandCategory {
@@ -409,7 +409,7 @@ export const commandCategories: readonly CommandCategory[] = [
409409
Command.UNFOCUS_SHELL_INPUT,
410410
Command.CLEAR_SCREEN,
411411
Command.RESTART_APP,
412-
Command.SUSPEND_APP,
412+
Command.SUSPEND,
413413
],
414414
},
415415
];
@@ -508,5 +508,5 @@ export const commandDescriptions: Readonly<Record<Command, string>> = {
508508
[Command.UNFOCUS_SHELL_INPUT]: 'Focus the Gemini input from the shell input.',
509509
[Command.CLEAR_SCREEN]: 'Clear the terminal screen and redraw the UI.',
510510
[Command.RESTART_APP]: 'Restart the application.',
511-
[Command.SUSPEND_APP]: 'Suspend the application (not yet implemented).',
511+
[Command.SUSPEND]: 'Suspend the CLI and move it to the background.',
512512
};

0 commit comments

Comments
 (0)