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
[Windows] Raw ANSI escape codes printed after Ctrl+C exit #13301
On Windows, pressing Ctrl+C to exit the application causes raw ANSI escape sequences (color codes) to be printed to the terminal after the process terminates. Exiting via the exit command works cleanly without this issue.
Root Cause
The @opentui/core renderer registers SIGINT (and other signal) handlers by default via addExitListeners(). On Windows, the app disables ENABLE_PROCESSED_INPUT so that Ctrl+C is delivered as a keyboard event instead of a signal. However, a race condition exists in the 100ms polling guard — Bun's runtime can momentarily re-enable the flag between polls. When Ctrl+C is pressed during this window, it generates SIGINT instead of a keyboard event, and opentui's handler calls renderer.destroy() directly, bypassing the app's graceful exit flow (process.exit, unguard, worker shutdown).
Steps to reproduce
Run opencode on Windows (PowerShell or Windows Terminal)
Press Ctrl+C to exit
Observe raw ANSI escape codes printed in the terminal after exit
Expected behavior
The application should exit cleanly without printing any ANSI escape codes, the same as when using the exit command.
These issues all describe similar symptoms of raw ANSI escape codes being printed to the terminal after Ctrl+C on Windows, which may be the same underlying bug with different manifestations.
Activity
github-actions commentedon Feb 12, 2026
This issue might be a duplicate of existing issues. Please check:
These issues all describe similar symptoms of raw ANSI escape codes being printed to the terminal after Ctrl+C on Windows, which may be the same underlying bug with different manifestations.
github-actions commentedon Apr 14, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.