Skip to content

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

Closed as not planned

Description

@RandyMcMillan

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 11, 2026
  2. github-actions commented on Jan 11, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These issues describe very similar terminal corruption/scrambling when exiting opencode. While those focus on Windows and specific Ctrl+C handling, they may share the same root cause related to terminal escape sequence cleanup on exit.

    Feel free to ignore if your case is specifically different from these.

  3. kommander commented on Jan 12, 2026

    @kommander
    Collaborator

    Is that happening when exiting with ctrl+c from the error boundary screen or just always? This only has been an issue on windows so far.

  4. RandyMcMillan commented on Jan 12, 2026

    @RandyMcMillan
    ContributorAuthor

    I will attempt to do a deeper investigation into open-tui. Maybe the appropriate fix needs to be there.

    I am not setup to debug in Windows.

  5. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  6. RandyMcMillan commented on Mar 26, 2026

    @RandyMcMillan
    ContributorAuthor

    i will recheck - it may have been addressed...

    thanks

  7. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions