diff --git a/docs/cli/keyboard-shortcuts.md b/docs/cli/keyboard-shortcuts.md index e56b508d68..96565a5cf3 100644 --- a/docs/cli/keyboard-shortcuts.md +++ b/docs/cli/keyboard-shortcuts.md @@ -26,17 +26,17 @@ available combinations. #### Editing -| Action | Keys | -| ------------------------------------------------ | -------------------------------------------------------------------------------------------- | -| Delete from the cursor to the end of the line. | `Ctrl + K` | -| Delete from the cursor to the start of the line. | `Ctrl + U` | -| Clear all text in the input field. | `Ctrl + C` | -| Delete the previous word. | `Ctrl + Backspace`
`Cmd + Backspace`
`Ctrl + ""`
`Cmd + ""`
`Ctrl + W` | -| Delete the next word. | `Ctrl + Delete`
`Cmd + Delete` | -| Delete the character to the left. | `Backspace`
`""`
`Ctrl + H` | -| Delete the character to the right. | `Delete`
`Ctrl + D` | -| Undo the most recent text edit. | `Ctrl + Z (no Shift)` | -| Redo the most recent undone text edit. | `Ctrl + Shift + Z` | +| Action | Keys | +| ------------------------------------------------ | --------------------------------------------------------- | +| Delete from the cursor to the end of the line. | `Ctrl + K` | +| Delete from the cursor to the start of the line. | `Ctrl + U` | +| Clear all text in the input field. | `Ctrl + C` | +| Delete the previous word. | `Ctrl + Backspace`
`Cmd + Backspace`
`Ctrl + W` | +| Delete the next word. | `Ctrl + Delete`
`Cmd + Delete` | +| Delete the character to the left. | `Backspace`
`Ctrl + H` | +| Delete the character to the right. | `Delete`
`Ctrl + D` | +| Undo the most recent text edit. | `Ctrl + Z (no Shift)` | +| Redo the most recent undone text edit. | `Ctrl + Shift + Z` | #### Screen Control diff --git a/packages/cli/src/config/keyBindings.ts b/packages/cli/src/config/keyBindings.ts index 915128487a..432d958489 100644 --- a/packages/cli/src/config/keyBindings.ts +++ b/packages/cli/src/config/keyBindings.ts @@ -136,8 +136,6 @@ export const defaultKeyBindings: KeyBindingConfig = { [Command.DELETE_WORD_BACKWARD]: [ { key: 'backspace', ctrl: true }, { key: 'backspace', command: true }, - { sequence: '\x7f', ctrl: true }, - { sequence: '\x7f', command: true }, { key: 'w', ctrl: true }, ], [Command.MOVE_LEFT]: [ @@ -158,11 +156,7 @@ export const defaultKeyBindings: KeyBindingConfig = { { key: 'right', command: true }, { key: 'f', command: true }, ], - [Command.DELETE_CHAR_LEFT]: [ - { key: 'backspace' }, - { sequence: '\x7f' }, - { key: 'h', ctrl: true }, - ], + [Command.DELETE_CHAR_LEFT]: [{ key: 'backspace' }, { key: 'h', ctrl: true }], [Command.DELETE_CHAR_RIGHT]: [{ key: 'delete' }, { key: 'd', ctrl: true }], [Command.DELETE_WORD_FORWARD]: [ { key: 'delete', ctrl: true }, diff --git a/packages/cli/src/ui/keyMatchers.test.ts b/packages/cli/src/ui/keyMatchers.test.ts index 4b112de358..06af0e0a95 100644 --- a/packages/cli/src/ui/keyMatchers.test.ts +++ b/packages/cli/src/ui/keyMatchers.test.ts @@ -102,11 +102,7 @@ describe('keyMatchers', () => { }, { command: Command.DELETE_CHAR_LEFT, - positive: [ - createKey('backspace'), - { ...createKey('\x7f'), sequence: '\x7f' }, - createKey('h', { ctrl: true }), - ], + positive: [createKey('backspace'), createKey('h', { ctrl: true })], negative: [createKey('h'), createKey('x', { ctrl: true })], }, { @@ -119,8 +115,6 @@ describe('keyMatchers', () => { positive: [ createKey('backspace', { ctrl: true }), createKey('backspace', { meta: true }), - { ...createKey('\x7f', { ctrl: true }), sequence: '\x7f' }, - { ...createKey('\x7f', { meta: true }), sequence: '\x7f' }, createKey('w', { ctrl: true }), ], negative: [createKey('backspace'), createKey('delete', { ctrl: true })],