Bug: Ctrl+C causes serialization issues in CLI TUI version #6654

Open
opened 2026-02-16 18:04:52 -05:00 by yindo · 1 comment
Owner

Originally created by @wang543851600 on GitHub (Jan 17, 2026).

Originally assigned to: @kommander on GitHub.

Bug Description

When pressing Ctrl+C in the CLI TUI version (not desktop), it causes serialization issues resulting in garbled characters or terminal state corruption.

Version

  • OpenCode CLI: v1.1.25
  • Platform: Windows

Expected Behavior

Ctrl+C should interrupt the current input or copy selected text without corrupting the terminal state.

Actual Behavior

Pressing Ctrl+C produces garbled characters or ECH sequences (\x1b[X) in the terminal, causing display issues.

Steps to Reproduce

  1. Start opencode CLI
  2. Type some text in the input
  3. Press Ctrl+C to cancel
  4. Observe garbled characters or corrupted display

Additional Context

  • This is the CLI/TUI version using @opentui/solid, not the desktop version using ghostty-web
  • A related fix for the desktop version exists in commit 9111005165 but it only addresses ghostty-web serialization, not the CLI TUI
  • The CLI TUI uses @opentui/solid for rendering

Suggested Fix

The CLI version likely needs similar serialization fixes in the TUI component to properly handle control characters (like Ctrl+C / 0x03) during terminal state serialization.

Originally created by @wang543851600 on GitHub (Jan 17, 2026). Originally assigned to: @kommander on GitHub. ## Bug Description When pressing Ctrl+C in the CLI TUI version (not desktop), it causes serialization issues resulting in garbled characters or terminal state corruption. ## Version - OpenCode CLI: v1.1.25 - Platform: Windows ## Expected Behavior Ctrl+C should interrupt the current input or copy selected text without corrupting the terminal state. ## Actual Behavior Pressing Ctrl+C produces garbled characters or ECH sequences (\x1b[X) in the terminal, causing display issues. ## Steps to Reproduce 1. Start opencode CLI 2. Type some text in the input 3. Press Ctrl+C to cancel 4. Observe garbled characters or corrupted display ## Additional Context - This is the CLI/TUI version using @opentui/solid, not the desktop version using ghostty-web - A related fix for the desktop version exists in commit 91110051658f42341ac713327991605461d4bb0b but it only addresses ghostty-web serialization, not the CLI TUI - The CLI TUI uses @opentui/solid for rendering ## Suggested Fix The CLI version likely needs similar serialization fixes in the TUI component to properly handle control characters (like Ctrl+C / 0x03) during terminal state serialization.
yindo added the windowsopentui labels 2026-02-16 18:04:52 -05:00
Author
Owner

@ValadaresX commented on GitHub (Jan 19, 2026):

+1, I’m seeing the same behavior on Windows with OpenCode CLI v1.1.25 (CLI/TUI using @opentui/solid, not the desktop/ghostty-web).
Ctrl+C intermittently results in garbled output / escape sequences like \x1b[X and sometimes corrupts the terminal state.
It doesn’t happen every time, but it reproduces with noticeable frequency during normal usage.

@ValadaresX commented on GitHub (Jan 19, 2026): +1, I’m seeing the same behavior on Windows with OpenCode CLI v1.1.25 (CLI/TUI using @opentui/solid, not the desktop/ghostty-web). Ctrl+C intermittently results in garbled output / escape sequences like \x1b[X and sometimes corrupts the terminal state. It doesn’t happen every time, but it reproduces with noticeable frequency during normal usage.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6654