Skip to content

[Bug] Terminal corrupted with raw ANSI escape sequences after killing Node processes on Windows (PowerShell) #20224

Closed as not planned

Description

@ogarridojimenez

Description

Describe the bug
When OpenCode exits or kills Node processes (e.g., when closing a session),
the terminal becomes corrupted. Raw ANSI escape sequences like
16M[555;35;24M[555;37 are printed directly to the terminal instead of
being interpreted as colors/formatting. The terminal becomes unusable and
the only fix is to open a new terminal window.

To Reproduce

  1. Open OpenCode in PowerShell on Windows
  2. Run a session that spawns Node processes
  3. Kill or close the session (Ctrl+C or taskkill)
  4. Observe terminal output flooding with raw ANSI sequences

Expected behavior
OpenCode should restore the terminal state on exit by calling the
appropriate cleanup (e.g., tput reset equivalent or restoring the
alternate screen buffer with \033[?1049l and resetting color with \033[0m).

Actual behavior
Terminal is left in a broken state with raw ANSI escape sequences
printed as plain text. reset and tput are not available on Windows
PowerShell, so recovery requires opening a new terminal.

Environment

  • OS: Windows 11
  • Terminal: PowerShell
  • OpenCode version: [your version here]

Screenshots
[attach your screenshots here]

Plugins

No response

OpenCode version

1.2.25

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

Windows 11

Terminal

Power Shell

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 31, 2026
  2. github-actions commented on Mar 31, 2026

    @github-actions
    Contributor

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

    If your issue is distinct from these, please clarify what makes it different.

  3. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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