Standard keyboard cursor navigation (Home/End key, ctrl+left/right key) #1748

Closed
opened 2026-02-16 17:32:26 -05:00 by yindo · 9 comments
Owner

Originally created by @JGKle on GitHub (Sep 17, 2025).

Originally assigned to: @kommander on GitHub.

  1. Type a very long prompt, such that it wraps to multiple lines
  2. Try using the Start/End keys.
  3. It moves the cursor to the very start/end of the entire prompt, rather than the start/end of the current line (which is standard/expected behavior - i.e. you can try it in ClaudeCode, or here in Github's textboxes).

This makes it very cumbersome to navigate around long prompts - i.e. it seems like the only way to get from one far edge of the input box to the other is to just hold the arrow key and wait for the key repeat.

If there's an alternative keybinding to do what Home/End typically does, I couldn't find it in https://opencode.ai/docs/keybinds.

Originally created by @JGKle on GitHub (Sep 17, 2025). Originally assigned to: @kommander on GitHub. 1. Type a very long prompt, such that it wraps to multiple lines 2. Try using the Start/End keys. 3. It moves the cursor to the very start/end of the entire prompt, rather than the start/end of the current line (which is standard/expected behavior - i.e. you can try it in ClaudeCode, or here in Github's textboxes). This makes it very cumbersome to navigate around long prompts - i.e. it seems like the only way to get from one far edge of the input box to the other is to just hold the arrow key and wait for the key repeat. If there's an alternative keybinding to do what Home/End typically does, I couldn't find it in https://opencode.ai/docs/keybinds.
yindo added the opentui label 2026-02-16 17:32:26 -05:00
yindo closed this issue 2026-02-16 17:32:26 -05:00
Author
Owner

@JGKle commented on GitHub (Sep 17, 2025):

Addendum: Ctrl+left arrow & ctrl+right arrow is also not exhibiting standard cursor navigation. It's supposed to jump the cursor to the start/end of the current word, but in opencode it has no effects (again can try it in ClaudeCode or Github's textboxes to see expected behavior.)

Addendum 2: it looks like it's using Alt+left & Alt+right to do what Ctrl+left & Ctrl+right is supposed to do. That's pretty confusing/nonstandard tho as that key combination typically means "navigate back" and "navigate forward" (i.e. in browsers, IDEs, etc).

@JGKle commented on GitHub (Sep 17, 2025): Addendum: Ctrl+left arrow & ctrl+right arrow is also not exhibiting standard cursor navigation. It's supposed to jump the cursor to the start/end of the current word, but in opencode it has no effects (again can try it in ClaudeCode or Github's textboxes to see expected behavior.) Addendum 2: it looks like it's using Alt+left & Alt+right to do what Ctrl+left & Ctrl+right is supposed to do. That's pretty confusing/nonstandard tho as that key combination typically means "navigate back" and "navigate forward" (i.e. in browsers, IDEs, etc).
Author
Owner

@sai-sy commented on GitHub (Sep 30, 2025):

do you know if this has anything to do with https://github.com/sst/opencode/issues/1975 and if that fixes your issue?

@sai-sy commented on GitHub (Sep 30, 2025): do you know if this has anything to do with https://github.com/sst/opencode/issues/1975 and if that fixes your issue?
Author
Owner

@JGKle commented on GitHub (Sep 30, 2025):

I'm back to ClaudeCode unfortunately, due to a number of critical issues in opencode (i.e. text copying is broken, can't give it screenshots, can't interrupt reliably). Will come back & try this again if/when those are addressed.

@JGKle commented on GitHub (Sep 30, 2025): I'm back to ClaudeCode unfortunately, due to a number of critical issues in opencode (i.e. [text copying is broken](https://github.com/sst/opencode/issues/2114), [can't give it screenshots](https://github.com/sst/opencode/issues/1504), [can't interrupt reliably](https://github.com/sst/opencode/issues/684)). Will come back & try this again if/when those are addressed.
Author
Owner

@rekram1-node commented on GitHub (Sep 30, 2025):

@JGKle lots of tui improvements coming soon, I think in a week or two all of these should be addressed, thanks for your feedback!

totally understandable, we are working on this!

@rekram1-node commented on GitHub (Sep 30, 2025): @JGKle lots of tui improvements coming soon, I think in a week or two all of these should be addressed, thanks for your feedback! totally understandable, we are working on this!
Author
Owner

@CSRessel commented on GitHub (Oct 15, 2025):

For those where this keybinding is a deal breaker, it can be solved with this comment's config:

https://github.com/sst/opencode/issues/1975#issuecomment-3192835872

{
  "$schema": "https://opencode.ai/config.json",
  "keybinds": {
    "session_child_cycle": "none",
    "session_child_cycle_reverse": "none",
  },

  ...
}
@CSRessel commented on GitHub (Oct 15, 2025): For those where this keybinding is a deal breaker, it can be solved with this comment's config: https://github.com/sst/opencode/issues/1975#issuecomment-3192835872 ```json { "$schema": "https://opencode.ai/config.json", "keybinds": { "session_child_cycle": "none", "session_child_cycle_reverse": "none", }, ... } ```
Author
Owner

@AdiKsOnDev commented on GitHub (Nov 27, 2025):

@rekram1-node this was fixed until v1.0.0 release. After that, with the same configuration (i.e. ctrl+rightarrow and ctrl+leftarrow being freed from any keybinds) ctrl+arrow keys isn't valid anymore, despite not being mapped to any feature in the Opencode configuration

@AdiKsOnDev commented on GitHub (Nov 27, 2025): @rekram1-node this was fixed until `v1.0.0` release. After that, with the same configuration (i.e. `ctrl+rightarrow` and `ctrl+leftarrow` being freed from any keybinds) ctrl+arrow keys isn't valid anymore, despite not being mapped to any feature in the Opencode configuration
Author
Owner

@rekram1-node commented on GitHub (Nov 30, 2025):

noted

@rekram1-node commented on GitHub (Nov 30, 2025): noted
Author
Owner

@doodhout commented on GitHub (Dec 11, 2025):

FYI this is fixed in version 1.0.147

@doodhout commented on GitHub (Dec 11, 2025): FYI this is fixed in version 1.0.147
Author
Owner

@Huge commented on GitHub (Jan 2, 2026):

With no keybinds configured the Home and End keys as well as PgUp/Down are moving in the chat history, not in the prompt, both in Alacritty and WSL shell. This is meant to be the default and changeble with the session_child_cycle": "none",?

If so, I'd like to propose Ctrl+these navigate the cursor in prompt area by default, currently they do nothing by default, I believe.

@Huge commented on GitHub (Jan 2, 2026): With no keybinds configured the Home and End keys as well as PgUp/Down are moving in the chat history, not in the prompt, both in Alacritty and WSL shell. This is meant to be the default and changeble with the `session_child_cycle": "none",`? If so, I'd like to propose Ctrl+these navigate the cursor in prompt area by default, currently they do nothing by default, I believe.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1748