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
- 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.
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
Operating System
Windows 11
Terminal
Power Shell
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;37are printed directly to the terminal instead ofbeing interpreted as colors/formatting. The terminal becomes unusable and
the only fix is to open a new terminal window.
To Reproduce
Expected behavior
OpenCode should restore the terminal state on exit by calling the
appropriate cleanup (e.g.,
tput resetequivalent or restoring thealternate screen buffer with
\033[?1049land resetting color with\033[0m).Actual behavior
Terminal is left in a broken state with raw ANSI escape sequences
printed as plain text.
resetandtputare not available on WindowsPowerShell, so recovery requires opening a new terminal.
Environment
Screenshots
[attach your screenshots here]
Plugins
No response
OpenCode version
1.2.25
Steps to reproduce
No response
Screenshot and/or share link
Operating System
Windows 11
Terminal
Power Shell