Terminal output becomes garbled after running for a while and also when pressing Ctrl+C #8812

Closed
opened 2026-02-16 18:10:54 -05:00 by yindo · 1 comment
Owner

Originally created by @RaymondGuoCGI on GitHub (Feb 8, 2026).

Originally assigned to: @kommander on GitHub.

Description

Description

The terminal output becomes garbled in two different situations:

  1. After Opencode has been running for a period of time, even without any interruption
  2. When pressing Ctrl+C to interrupt the process

In both cases, the terminal starts printing raw ANSI escape sequences

Image

, and the screen becomes unreadable.

Steps to reproduce

Case 1: After running for a while

  1. Run Opencode in a Windows terminal
  2. Let it run for some time during normal operation
  3. Observe that the terminal output gradually becomes garbled

Case 2: After pressing Ctrl+C

  1. Run Opencode in a Windows terminal
  2. Press Ctrl+C while it is running
  3. Observe that the terminal output immediately becomes garbled

Expected behavior

The terminal output should remain readable during long-running sessions,
and the terminal state should be properly restored after Ctrl+C.

Actual behavior

The terminal enters a corrupted state and continues printing raw ANSI escape codes.

Environment

  • OS: Windows
  • Terminal: Windows Terminal (or cmd / PowerShell)
  • Opencode version: (please fill in)
  • Model / Agent: GPT-5.3 Codex / Sisyphus

Additional notes

This appears to be related to terminal state management.
The terminal may be left in raw mode or not properly reset,
both during long-running execution and after handling SIGINT.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @RaymondGuoCGI on GitHub (Feb 8, 2026). Originally assigned to: @kommander on GitHub. ### Description ### Description The terminal output becomes garbled in two different situations: 1. After Opencode has been running for a period of time, even without any interruption 2. When pressing **Ctrl+C** to interrupt the process In both cases, the terminal starts printing raw ANSI escape sequences <img width="2048" height="1016" alt="Image" src="https://github.com/user-attachments/assets/866b003d-5f9b-49a0-b1a8-f986b2d1f801" /> , and the screen becomes unreadable. ### Steps to reproduce #### Case 1: After running for a while 1. Run Opencode in a Windows terminal 2. Let it run for some time during normal operation 3. Observe that the terminal output gradually becomes garbled #### Case 2: After pressing Ctrl+C 1. Run Opencode in a Windows terminal 2. Press **Ctrl+C** while it is running 3. Observe that the terminal output immediately becomes garbled ### Expected behavior The terminal output should remain readable during long-running sessions, and the terminal state should be properly restored after Ctrl+C. ### Actual behavior The terminal enters a corrupted state and continues printing raw ANSI escape codes. ### Environment - OS: Windows - Terminal: Windows Terminal (or cmd / PowerShell) - Opencode version: (please fill in) - Model / Agent: GPT-5.3 Codex / Sisyphus ### Additional notes This appears to be related to terminal state management. The terminal may be left in raw mode or not properly reset, both during long-running execution and after handling SIGINT. ### Plugins _No response_ ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the windowsopentuibug labels 2026-02-16 18:10:54 -05:00
yindo closed this issue 2026-02-16 18:10:54 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 8, 2026):

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

  • #11826: Ctrl-C Bug Report - Reports garbled text and inability to properly interrupt program on Windows PowerShell
  • #10265: Ctrl+C during response causes terminal to print endless garbage and become unresponsive - Garbled text continues indefinitely after Ctrl+C
  • #11748: After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the powershell will cause garbled characters
  • #10414: OpenCode crashes during use on Windows (garbled console output) - Terminal becomes garbled/illegible after running for a while
  • #7062: Pressing Ctrl+C in input field outputs ANSI escape sequences/garbled text - Raw ANSI escape codes printed instead of normal behavior
  • #9183: Bug: Ctrl+C causes serialization issues in CLI TUI version - Garbled characters from control character serialization
  • #8159: Bug: Ctrl+C causes terminal UI rendering overlap on Windows Terminal - UI rendering issues after Ctrl+C

All of these issues report similar symptoms:

  • Terminal garbling with raw ANSI escape sequences
  • Issues related to Ctrl+C handling on Windows
  • Terminal state corruption during operation

Feel free to ignore if your specific case has unique circumstances not covered by these issues.

@github-actions[bot] commented on GitHub (Feb 8, 2026): This issue might be a duplicate of existing issues. Please check: - #11826: Ctrl-C Bug Report - Reports garbled text and inability to properly interrupt program on Windows PowerShell - #10265: Ctrl+C during response causes terminal to print endless garbage and become unresponsive - Garbled text continues indefinitely after Ctrl+C - #11748: After closing the OpenCode CLI, scrolling the mouse wheel and moving the mouse in the powershell will cause garbled characters - #10414: OpenCode crashes during use on Windows (garbled console output) - Terminal becomes garbled/illegible after running for a while - #7062: Pressing Ctrl+C in input field outputs ANSI escape sequences/garbled text - Raw ANSI escape codes printed instead of normal behavior - #9183: Bug: Ctrl+C causes serialization issues in CLI TUI version - Garbled characters from control character serialization - #8159: Bug: Ctrl+C causes terminal UI rendering overlap on Windows Terminal - UI rendering issues after Ctrl+C All of these issues report similar symptoms: - Terminal garbling with raw ANSI escape sequences - Issues related to Ctrl+C handling on Windows - Terminal state corruption during operation Feel free to ignore if your specific case has unique circumstances not covered by these issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8812