mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 19:05:11 +00:00
feat(tui,coding-agent): add shell-style keybindings alt+b, alt+f, ctrl+d
- Add alt+b/alt+f as alternative bindings for cursorWordLeft/cursorWordRight - Add ctrl+d as alternative binding for deleteCharForward - Fix ctrl+d in custom editor to perform delete when text is present (previously it was always consumed, even with non-empty input) Closes #1043 Co-authored-by: Jason Ish <ish@unx.ca>
This commit is contained in:
parent
5ef79459dc
commit
81be81328c
5 changed files with 16 additions and 7 deletions
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Added shell-style keybindings: `alt+b`/`alt+f` for word navigation, `ctrl+d` for delete character forward (when editor has text) ([#1043](https://github.com/badlogic/pi-mono/issues/1043) by [@jasonish](https://github.com/jasonish))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Empty array in package filter now disables all resources instead of falling back to manifest defaults ([#1044](https://github.com/badlogic/pi-mono/issues/1044))
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, etc.
|
|||
| `cursorDown` | `down` | Move cursor down |
|
||||
| `cursorLeft` | `left` | Move cursor left |
|
||||
| `cursorRight` | `right` | Move cursor right |
|
||||
| `cursorWordLeft` | `alt+left`, `ctrl+left` | Move cursor word left |
|
||||
| `cursorWordRight` | `alt+right`, `ctrl+right` | Move cursor word right |
|
||||
| `cursorWordLeft` | `alt+left`, `ctrl+left`, `alt+b` | Move cursor word left |
|
||||
| `cursorWordRight` | `alt+right`, `ctrl+right`, `alt+f` | Move cursor word right |
|
||||
| `cursorLineStart` | `home`, `ctrl+a` | Move to line start |
|
||||
| `cursorLineEnd` | `end`, `ctrl+e` | Move to line end |
|
||||
| `pageUp` | `pageUp` | Scroll up by page |
|
||||
|
|
@ -35,7 +35,7 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, etc.
|
|||
| Action | Default | Description |
|
||||
|--------|---------|-------------|
|
||||
| `deleteCharBackward` | `backspace` | Delete character backward |
|
||||
| `deleteCharForward` | `delete` | Delete character forward |
|
||||
| `deleteCharForward` | `delete`, `ctrl+d` | Delete character forward |
|
||||
| `deleteWordBackward` | `ctrl+w`, `alt+backspace` | Delete word backward |
|
||||
| `deleteWordForward` | `alt+d`, `alt+delete` | Delete word forward |
|
||||
| `deleteToLineStart` | `ctrl+u` | Delete to line start |
|
||||
|
|
|
|||
|
|
@ -61,8 +61,9 @@ export class CustomEditor extends Editor {
|
|||
if (this.getText().length === 0) {
|
||||
const handler = this.onCtrlD ?? this.actionHandlers.get("exit");
|
||||
if (handler) handler();
|
||||
return;
|
||||
}
|
||||
return; // Always consume
|
||||
// Fall through to editor handling for delete-char-forward when not empty
|
||||
}
|
||||
|
||||
// Check all other app actions
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Added `alt+b` and `alt+f` as alternative keybindings for word navigation (`cursorWordLeft`, `cursorWordRight`) and `ctrl+d` for `deleteCharForward` ([#1043](https://github.com/badlogic/pi-mono/issues/1043) by [@jasonish](https://github.com/jasonish))
|
||||
|
||||
## [0.50.1] - 2026-01-26
|
||||
|
||||
## [0.50.0] - 2026-01-26
|
||||
|
|
|
|||
|
|
@ -68,15 +68,15 @@ export const DEFAULT_EDITOR_KEYBINDINGS: Required<EditorKeybindingsConfig> = {
|
|||
cursorDown: "down",
|
||||
cursorLeft: "left",
|
||||
cursorRight: "right",
|
||||
cursorWordLeft: ["alt+left", "ctrl+left"],
|
||||
cursorWordRight: ["alt+right", "ctrl+right"],
|
||||
cursorWordLeft: ["alt+left", "ctrl+left", "alt+b"],
|
||||
cursorWordRight: ["alt+right", "ctrl+right", "alt+f"],
|
||||
cursorLineStart: ["home", "ctrl+a"],
|
||||
cursorLineEnd: ["end", "ctrl+e"],
|
||||
pageUp: "pageUp",
|
||||
pageDown: "pageDown",
|
||||
// Deletion
|
||||
deleteCharBackward: "backspace",
|
||||
deleteCharForward: "delete",
|
||||
deleteCharForward: ["delete", "ctrl+d"],
|
||||
deleteWordBackward: ["ctrl+w", "alt+backspace"],
|
||||
deleteWordForward: ["alt+d", "alt+delete"],
|
||||
deleteToLineStart: "ctrl+u",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue