You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Terminal corrupted with raw ANSI escape sequences after killing Node processes on Windows (PowerShell) #20224
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
Open OpenCode in PowerShell on Windows
Run a session that spawns Node processes
Kill or close the session (Ctrl+C or taskkill)
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.
Activity
github-actions commentedon Mar 31, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from these, please clarify what makes it different.
fix: reset Windows terminal on exit to prevent ANSI corruption
github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.