Skip to content

Bug: Ctrl+C interruption in opencode causes terminal corruption with ANSI escape sequences #5990

Closed as duplicate

Description

@estudiochapunov

Description

When using opencode CLI, pressing Ctrl+C (intended as Esc) interrupts the session, leading to terminal corruption. After interruption, cursor/mouse movements display corrupted ANSI escape sequences (e.g., [^[[H for cursor home, [^[[2J for clear screen). The screen remains with opencode content, but keyboard partially loses control.

Upon closing and reopening the terminal, opencode is no longer in PATH (even though set persistently), requiring manual re-addition.

Steps to Reproduce

  1. Start opencode in CMD or PowerShell.
  2. During session, press Ctrl+C to interrupt.
  3. Observe terminal corruption (ANSI escape codes on cursor/mouse input).
  4. Close and reopen terminal.
  5. opencode command not found.

Environment

  • OS: Windows 11 Home (build 10.0.26220)
  • Terminal: CMD / PowerShell 7.5.4
  • opencode version: 1.0.186
  • PATH includes opencode via setx

Expected Behavior

Ctrl+C should cleanly exit without corrupting terminal or affecting PATH persistence.

Actual Behavior

Terminal corrupted with ANSI escapes, PATH changes not applied after restart.

Additional Notes

Issue may relate to signal handling or terminal integration on Windows. PATH persistence via setx works in normal cases.

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 22, 2025
  2. github-actions commented on Dec 22, 2025

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  3. rekram1-node commented on Dec 22, 2025

    @rekram1-node
    Collaborator

    There is an upstream bug in bun that we hope to get fixed

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

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions