opencode
opencode copied to clipboard
macOS: Terminal becomes unusable after opencode exits ("dead terminal")
Description
When running opencode on macOS and exiting (Ctrl+C, closing terminal, or normal exit), the terminal is left in an unusable state with scrambled output, requiring users to manually reset it with reset command or reopen terminal.
Expected Behavior: Terminal should be restored to a usable state when opencode exits.
Actual Behavior: Terminal is left in a corrupted state with:
- Scrambled text output
- Unresponsive input
- Cursor positioning issues
- Requires manual
resetcommand Environment - OS: macOS (any version)
- Terminal: Terminal.app, iTerm2, ...
- opencode version: [current] Additional Context This appears to be related to terminal escape sequences and alternate screen buffer management not being properly cleaned up on exit.
Plugins
No response
OpenCode version
No response
Steps to reproduce
- Run opencode on macOS (Terminal.app, iTerm2, ...)
- Use the application normally
- Exit opencode using Ctrl+C or normal exit
- Terminal becomes corrupted/unresponsive
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response