opencode icon indicating copy to clipboard operation
opencode copied to clipboard

macOS: Terminal becomes unusable after opencode exits ("dead terminal")

Open RandyMcMillan opened this issue 3 days ago • 3 comments

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 reset command 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

  1. Run opencode on macOS (Terminal.app, iTerm2, ...)
  2. Use the application normally
  3. Exit opencode using Ctrl+C or normal exit
  4. Terminal becomes corrupted/unresponsive

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

RandyMcMillan avatar Jan 11 '26 20:01 RandyMcMillan