feat(cli): switch to ctrl+g from ctrl-x (#24861)

This commit is contained in:
Jacob Richman
2026-04-07 23:22:45 -07:00
committed by GitHub
parent 7e1938c1bc
commit cbacdc67d0
13 changed files with 71 additions and 36 deletions
+7 -2
View File
@@ -77,6 +77,7 @@ export enum Command {
QUEUE_MESSAGE = 'input.queueMessage',
NEWLINE = 'input.newline',
OPEN_EXTERNAL_EDITOR = 'input.openExternalEditor',
DEPRECATED_OPEN_EXTERNAL_EDITOR = 'input.deprecatedOpenExternalEditor',
PASTE_CLIPBOARD = 'input.paste',
// App Controls
@@ -375,7 +376,8 @@ export const defaultKeyBindingConfig: KeyBindingConfig = new Map([
new KeyBinding('ctrl+j'),
],
],
[Command.OPEN_EXTERNAL_EDITOR, [new KeyBinding('ctrl+x')]],
[Command.OPEN_EXTERNAL_EDITOR, [new KeyBinding('ctrl+g')]],
[Command.DEPRECATED_OPEN_EXTERNAL_EDITOR, [new KeyBinding('ctrl+x')]],
[
Command.PASTE_CLIPBOARD,
[
@@ -388,7 +390,7 @@ export const defaultKeyBindingConfig: KeyBindingConfig = new Map([
// App Controls
[Command.SHOW_ERROR_DETAILS, [new KeyBinding('f12')]],
[Command.SHOW_FULL_TODOS, [new KeyBinding('ctrl+t')]],
[Command.SHOW_IDE_CONTEXT_DETAIL, [new KeyBinding('ctrl+g')]],
[Command.SHOW_IDE_CONTEXT_DETAIL, [new KeyBinding('f4')]],
[Command.TOGGLE_MARKDOWN, [new KeyBinding('alt+m')]],
[Command.TOGGLE_COPY_MODE, [new KeyBinding('f9')]],
[Command.TOGGLE_MOUSE_MODE, [new KeyBinding('ctrl+s')]],
@@ -510,6 +512,7 @@ export const commandCategories: readonly CommandCategory[] = [
Command.QUEUE_MESSAGE,
Command.NEWLINE,
Command.OPEN_EXTERNAL_EDITOR,
Command.DEPRECATED_OPEN_EXTERNAL_EDITOR,
Command.PASTE_CLIPBOARD,
],
},
@@ -626,6 +629,8 @@ export const commandDescriptions: Readonly<Record<Command, string>> = {
[Command.NEWLINE]: 'Insert a newline without submitting.',
[Command.OPEN_EXTERNAL_EDITOR]:
'Open the current prompt or the plan in an external editor.',
[Command.DEPRECATED_OPEN_EXTERNAL_EDITOR]:
'Deprecated command to open external editor.',
[Command.PASTE_CLIPBOARD]: 'Paste from the clipboard.',
// App Controls
+7 -2
View File
@@ -311,6 +311,11 @@ describe('keyMatchers', () => {
// External tools
{
command: Command.OPEN_EXTERNAL_EDITOR,
positive: [createKey('g', { ctrl: true })],
negative: [createKey('g'), createKey('c', { ctrl: true })],
},
{
command: Command.DEPRECATED_OPEN_EXTERNAL_EDITOR,
positive: [createKey('x', { ctrl: true })],
negative: [createKey('x'), createKey('c', { ctrl: true })],
},
@@ -336,8 +341,8 @@ describe('keyMatchers', () => {
},
{
command: Command.SHOW_IDE_CONTEXT_DETAIL,
positive: [createKey('g', { ctrl: true })],
negative: [createKey('g'), createKey('t', { ctrl: true })],
positive: [createKey('f4')],
negative: [createKey('f5'), createKey('t', { ctrl: true })],
},
{
command: Command.TOGGLE_MARKDOWN,