Skip to content

Commit 0b5947f

Browse files
committed
fix(keyboard): add CMD+Left/Right to default keybindings
Add CMD+Left (goLineStart) and CMD+Right (goLineEnd) to Chat context defaults. These are now officially discoverable and overrideable by users, rather than relying solely on hardcoded fallthrough logic.
1 parent a18cbda commit 0b5947f

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src-rust/crates/core/src/keybindings.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ pub fn default_bindings() -> Vec<ParsedBinding> {
167167
("ctrl+j", "newline", KeyContext::Chat),
168168
("home", "goLineStart", KeyContext::Chat),
169169
("end", "goLineEnd", KeyContext::Chat),
170+
("cmd+left", "goLineStart", KeyContext::Chat),
171+
("cmd+right", "goLineEnd", KeyContext::Chat),
170172

171173
// Text Editing (Emacs-style) + app shortcuts
172174
("ctrl+a", "openModelPicker", KeyContext::Chat),

src-rust/crates/tui/src/app.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4093,15 +4093,19 @@ impl App {
40934093
self.refresh_prompt_input();
40944094
}
40954095
KeyCode::Left => {
4096-
if key.modifiers.contains(KeyModifiers::CONTROL) {
4096+
if key.modifiers.contains(KeyModifiers::SUPER) {
4097+
self.prompt_input.cursor = 0;
4098+
} else if key.modifiers.contains(KeyModifiers::CONTROL) {
40974099
self.prompt_input.move_word_backward();
40984100
} else {
40994101
self.prompt_input.move_left();
41004102
}
41014103
self.sync_legacy_prompt_fields();
41024104
}
41034105
KeyCode::Right => {
4104-
if key.modifiers.contains(KeyModifiers::CONTROL) {
4106+
if key.modifiers.contains(KeyModifiers::SUPER) {
4107+
self.prompt_input.cursor = self.prompt_input.text.len();
4108+
} else if key.modifiers.contains(KeyModifiers::CONTROL) {
41054109
self.prompt_input.move_word_forward();
41064110
} else {
41074111
self.prompt_input.move_right();

0 commit comments

Comments
 (0)