alt+right arrow binding on macOS sometimes jumps to the end of the line instead of moving forward word by word #3396

Closed
opened 2026-02-16 17:39:55 -05:00 by yindo · 3 comments
Owner

Originally created by @nikvdp on GitHub (Dec 8, 2025).

Description

This is an intermittent issue, it seems to behave differently based on where in the text input area the cursor is located and whether you've previously deleted text using backspace or not.

For context: on macOS alt+right moves is a system-wide shortcut to move forward a word. This works correctly inside opencode most of the time, but for some inputs it will move word-wise while you're in the beginning of the text area, but after crossing some mysterious threshold pressing it again will suddenly cause it jump to the end of the line, skipping many words along the way.

It's tricky to reproduce intentionally, but common enough in daily use to be mildly infuriating. The steps below reliably reproduce the issue

OpenCode version

1.0.134

Steps to reproduce

  1. Start a new opencode session
  2. Type or paste reproducing this is surprisingly tricky. seems to have to do with deletion.
  3. Use alt+left to move the cursor to the . right after the word "tricky"
  4. Use backspace to delete the word tricky.
  5. Re-type "tricky."
  6. Hit alt+left a few times to move the cursor to the beginning of "surprisingly"
  7. hit alt+right a few times and after passing the word "tricky" the cursor will jump to the end of the line instead of continuing to move word-wise

Screenshot and/or share link

No response

Operating System

macOS

Terminal

Ghostty

Originally created by @nikvdp on GitHub (Dec 8, 2025). ### Description This is an intermittent issue, it seems to behave differently based on where in the text input area the cursor is located and whether you've previously deleted text using backspace or not. For context: on macOS alt+right moves is a system-wide shortcut to move forward a word. This works correctly inside opencode most of the time, but for some inputs it will move word-wise while you're in the beginning of the text area, but after crossing some mysterious threshold pressing it again will suddenly cause it jump to the end of the line, skipping many words along the way. It's tricky to reproduce intentionally, but common enough in daily use to be mildly infuriating. The steps below reliably reproduce the issue ### OpenCode version 1.0.134 ### Steps to reproduce 1. Start a new opencode session 2. Type or paste `reproducing this is surprisingly tricky. seems to have to do with deletion.` 3. Use alt+left to move the cursor to the `.` right after the word "tricky" 4. Use backspace to delete the word tricky. 5. Re-type "tricky." 6. Hit alt+left a few times to move the cursor to the beginning of "surprisingly" 7. hit alt+right a few times and after passing the word "tricky" the cursor will jump to the end of the line instead of continuing to move word-wise ### Screenshot and/or share link _No response_ ### Operating System macOS ### Terminal Ghostty
yindo added the opentuibug labels 2026-02-16 17:39:55 -05:00
yindo closed this issue 2026-02-16 17:39:56 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 8, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4261: Option+Right not jumping words as intended in some scenarios

Both issues describe similar behavior with macOS alt+right/option+right jumping to the end of the line instead of moving word-by-word. Feel free to ignore if there are specific differences in your case.

For keybind-related issues, please also check our pinned keybinds documentation: #4997

@github-actions[bot] commented on GitHub (Dec 8, 2025): This issue might be a duplicate of existing issues. Please check: - #4261: Option+Right not jumping words as intended in some scenarios Both issues describe similar behavior with macOS alt+right/option+right jumping to the end of the line instead of moving word-by-word. Feel free to ignore if there are specific differences in your case. For keybind-related issues, please also check our pinned keybinds documentation: #4997
Author
Owner

@nikvdp commented on GitHub (Dec 8, 2025):

Update: the reproduction steps are different, but this seems to be the same underlying bug as https://github.com/sst/opencode/issues/4261. I opened a PR on opentui which has fixed the issue for me https://github.com/sst/opentui/pull/394

@nikvdp commented on GitHub (Dec 8, 2025): Update: the reproduction steps are different, but this seems to be the same underlying bug as https://github.com/sst/opencode/issues/4261. I opened a PR on opentui which has fixed the issue for me https://github.com/sst/opentui/pull/394
Author
Owner

@ariane-emory commented on GitHub (Dec 8, 2025):

@nikvdp Fantastic, hope your PR comes in for a safe landing soon! This one's been irritating me for a while, I'd love to see it fixed.

@ariane-emory commented on GitHub (Dec 8, 2025): @nikvdp Fantastic, hope your PR comes in for a safe landing soon! This one's been irritating me for a while, I'd love to see it fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3396