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
Terminal raw mode not restored after abnormal exit — input broken, Ctrl-like behavior #30920
When opencode gets stuck during the "thinking" phase and I press Esc twice to abort, the program exits abnormally and leaves the terminal in raw mode. After this happens:
Every keypress is interpreted as if Ctrl is held down (e.g., pressing C triggers Ctrl+C)
Chinese characters and most other keys cannot be typed
The issue persists across all applications in the same terminal window
Only restarting PowerShell (or running reset / stty sane) restores normal input
Plugins
No response
OpenCode version
OpenCode 1.15.13
Steps to reproduce
Run opencode
Wait for the model to start "thinking" (or get stuck)
Press Esc twice
Try typing in the terminal — characters are either interpreted as control sequences or cannot be input at all
If your issue is distinct (e.g. specific to the Esc-twice abort path or the Ctrl-like key behavior), feel free to clarify and a maintainer will follow up.
This is likely related to #21277 and #17081. However, my report identifies a specific trigger path: pressing Esc twice during the "thinking" phase triggers an abnormal exit that bypasses the normal Interface.close() cleanup. I also located the exact SIGINT handler at line 306145 in the compiled binary which calls process.exit() without setRawMode(false). If this specific trigger path isn't covered by the existing issues, I can help test a fix. Happy to close as duplicate if the maintainers confirm the fix for #21277/#17081 also addresses the Esc-twice abort scenario.
---- Replied Message ----
| From | ***@***.***> |
| Date | 6/5/2026 17:49 |
| To | ***@***.***> |
| Cc | ***@***.***>,
***@***.***> |
| Subject | Re: [anomalyco/opencode] Terminal raw mode not restored after abnormal exit — input broken, Ctrl-like behavior (Issue #30920) |
github-actions[bot] left a comment (anomalyco/opencode#30920)
This issue might be a duplicate of existing issues. Please check:
#21277: Terminal left with raw ANSI escape codes / broken state after crash on Windows PowerShell — same root cause (terminal raw mode not cleaned up on abnormal exit), different symptom manifestation
#17081: Stale stdin bytes and raw mode not restored after exit — covers the raw mode cleanup issue more broadly, with related issues listed there
If your issue is distinct (e.g. specific to the Esc-twice abort path or the Ctrl-like key behavior), feel free to clarify and a maintainer will follow up.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you authored the thread.Message ID: ***@***.***>
Activity
github-actions commentedon Jun 5, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct (e.g. specific to the Esc-twice abort path or the Ctrl-like key behavior), feel free to clarify and a maintainer will follow up.
sunny198305 commentedon Jun 5, 2026
github-actions commentedon Aug 5, 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.