Skip to content

TUI freezes on blank screen at startup, no error, requires force-kill #41284

Closed as not planned

Description

@herve-coulon

Bug: TUI freezes on blank screen at startup, no error, requires force-kill

Environment

Description

Launching opencode in a normal project directory results in a completely blank screen. The process starts successfully, loads all config files without any error, then hangs silently before rendering the TUI. No error, no panic, no output — it simply never proceeds past initialization. The process must be force-killed (Cmd+Q / killall -9); Ctrl+C does not respond.

Confirmed not caused by:

  • Project or global config content (reproduced with config file removed/restored, and with a autoupdate: false key added — no change in behavior)
  • Local plugins (reproduced with ~/.config/opencode/plugin and ~/.opencode/plugin moved out of the way)
  • Version — same freeze occurs on both 1.18.14 and 1.18.15
  • Terminal state — reproduced after a full reset, after quitting and reopening Terminal.app in a fresh, larger window, and after clearing ~/.cache/opencode and ~/.local/share/opencode

Log output (--print-logs)

timestamp=2026-08-08T14:39:07.233Z level=INFO run=d9dbd7f1 message="creating instance" directory=/Users/vevertluisant
timestamp=2026-08-08T14:39:07.234Z level=INFO run=d9dbd7f1 message=fromDirectory directory=/Users/vevertluisant
timestamp=2026-08-08T14:39:07.334Z level=INFO run=d9dbd7f1 message=bootstrapping directory=/Users/vevertluisant
timestamp=2026-08-08T14:39:07.338Z level=INFO run=d9dbd7f1 message=loading path=/Users/vevertluisant/.config/opencode/config.json
timestamp=2026-08-08T14:39:07.339Z level=INFO run=d9dbd7f1 message=loading path=/Users/vevertluisant/.config/opencode/opencode.json
timestamp=2026-08-08T14:39:07.339Z level=INFO run=d9dbd7f1 message=loading path=/Users/vevertluisant/.config/opencode/opencode.jsonc
timestamp=2026-08-08T14:39:07.362Z level=INFO run=d9dbd7f1 message=loading path=/Users/vevertluisant/.opencode/opencode.json
timestamp=2026-08-08T14:39:07.362Z level=INFO run=d9dbd7f1 message=loading path=/Users/vevertluisant/.opencode/opencode.jsonc
[--- nothing logged for 2m33s ---]
timestamp=2026-08-08T14:41:40.980Z level=INFO run=d9dbd7f1 message="disposing all instances"

The last log line before the freeze is the final config-file load (.opencode/opencode.jsonc). Nothing is logged between that line and the forced shutdown 2 minutes 33 seconds later — the hang happens after config loading completes and before any TUI/render-related log line appears.

Steps to reproduce

  1. Open Terminal.app on macOS (Apple Silicon)
  2. cd ~ (or any project directory)
  3. Run opencode
  4. Screen stays blank indefinitely; Ctrl+C does nothing; process must be force-killed

Expected behavior

TUI renders normally after config loading, as it has in prior sessions on this same machine/config.

Additional context

  • After a forced kill, the terminal is sometimes left emitting raw ANSI mouse-tracking codes (;NNMNN sequences) until printf '\e[?1000l\e[?1002l\e[?1003l\e[?1006l\e[?1049l\e[0m' + reset is run — consistent with known mouse-reporting cleanup issues on force-exit.
  • opencode --version and opencode --help work fine, confirming this is isolated to TUI initialization, not the binary itself.

Activity

  1. github-actions commented on Aug 8, 2026

    @github-actions
    Contributor

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

  2. sethen commented on Aug 9, 2026

    @sethen

    Same thing here

  3. lingengyuan commented on Sep 22, 2026

    @lingengyuan

    Another macOS repro today (1.18.30), this time after resuming a large session rather than a fresh opencode launch. Same end state as the OP: blank/white TUI, no log error, keystrokes (including quit) ignored, only kill -9 recovers.

    Repro

    opencode -s ses_f37f75a4cffeL4fagJyNraDOyB
    # session was already large: 8,295 parts / 124 messages / ~32k events

    Previous instance of that session had been killed earlier (likely OOM-adjacent — see #50578). Reloading it produced:

    Observation Value
    PID state after ~10 min S+, 0.1–0.5% CPU, RSS ~2.5 GB
    Last log line (run=37b3e4a4) message="booting location services" directory=...
    ERROR / panic / WARN for that run none
    Main thread (sample, 2s) blocked in kevent64 (event-loop wait, not a busy spin)
    Children none
    stdin still /dev/ttys000, but no key handling
    DB PRAGMA integrity_check → ok

    Boot sequence matches this issue: config loads → init count=56 → watcher → booting location services → silence. A healthy run of the same directory continues within ~12s to command / loop / session work; this run never got there.

    Why this repro matters

    The blank freeze here is preceded by an immediate multi-GB RSS spike on session resume (25 MB of parts → ~2.2 GB RSS in ~33 s). Heap analysis and vmmap for that path are in #50578. Plausible link: heavy resume allocation / layout work leaves the TUI before the first paint or before the input loop is fully live, so the process sits idle in kevent64 with nothing drawn and no keybind handling.

    Related: #44337 (empty frames on Apple Silicon), #32560 / #35494 (blank startup hang), #50578 (resume RSS spike + heap snapshots).

    Environment

    opencode: 1.18.30 (Homebrew)
    os:       macOS 26.6.2 (25G83), arm64
    terminal: ghostty 1.3.1
    

    Happy to re-run with --print-logs / take a fresh heap snapshot if that helps.

  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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