Skip to content

Opencode freezes when pressing option + left arrow key on MacBook with high CPU usage #2688

Closed

Description

@h4ni0

When I'm in opencode, and I press option + left arrow key, opencode freezes and I notice this process that spikes:

Image

Activity

  1. rekram1-node commented on Sep 19, 2025

    @rekram1-node
    Collaborator

    That's weird I can replicate, this may be fixed once opentui migration is complete

  2. aemr3 commented on Sep 19, 2025

    @aemr3

    When I'm in opencode, and I press option + left arrow key, opencode freezes and I notice this process that spikes:

    yes I have experienced it as well, I'm using shift + arrow keys without any problems.

    {
      "keybinds": {
        "session_child_cycle": "shift+right",
        "session_child_cycle_reverse": "shift+left"
      }
    }
    
  3. lloydrichards commented on Sep 29, 2025

    @lloydrichards

    Just ran into the same issue since v0.13.4 (see #2854) but also noticed that it only had this issue with Ghostty (1.2.0). Will close my other issue and follow this one for a solution 🤞

  4. lloydrichards commented on Oct 1, 2025

    @lloydrichards

    in v0.13.7, I'm no longer having this issue

  5. towry commented on Oct 24, 2025

    @towry
  6. pedropombeiro commented on Feb 7, 2026

    @pedropombeiro

    I've traced the root cause of this issue to the @opentui/core package's stdin buffer handling.

    Root Cause

    In packages/core/src/lib/stdin-buffer.ts, the isCompleteSequence function doesn't handle double-escape sequences (like \x1b\x1b[D for Option+Left). When the terminal sends this sequence:

    1. The function sees it starts with ESC (\x1b)
    2. afterEsc = \x1b[D (starts with ESC, not [)
    3. None of the pattern checks match
    4. Falls through to return "complete" - treating \x1b\x1b as complete
    5. The remaining [D is emitted as literal text

    This is why users see [D or [C printed instead of cursor movement.

    Filed Upstream

    I've filed an issue with a proposed fix in the opentui repo:
    anomalyco/opentui#644

  7. github-actions commented on Apr 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions