Skip to content

OpenCode does not show UI in terminal or web #11092

Closed

Description

@jara505

Description

Problem Description
When starting OpenCode on Linux, the interface does not appear in the terminal and in the browser it loads indefinitely. The process never reaches the point of displaying the UI.

What I have tried so far

  • Running opencode and opencode web
  • Switching Node versions (20 and 24)
  • Installing older versions of OpenCode (including 0.8.x), but none worked
  • Using environment variables:
    • OPENCODE_DISABLE_PLUGINS=1
    • OPENCODE_DISABLE_DEFAULT_PLUGINS=true
  • Clearing configuration and cache (~/.config/opencode, ~/.cache/opencode)
  • Running opencode uninstall and reinstalling

None of this has solved the issue; even after opencode uninstall, the UI still does not appear.

Relevant logs

INFO  2026-01-29T04:21:32 +694ms service=server method=GET path=/ request
INFO  2026-01-29T04:21:32 +0ms service=server status=started method=GET path=/ request
INFO  2026-01-29T04:21:32 +4ms service=default directory=/home/prueba creating instance
INFO  2026-01-29T04:21:32 +3ms service=project directory=/home/prueba fromDirectory
INFO  2026-01-29T04:21:32 +8ms service=storage index=0 running migration
INFO  2026-01-29T04:21:32 +5ms service=storage index=1 running migration
INFO  2026-01-29T04:21:32 +17ms service=default directory=/home/prueba bootstrapping
INFO  2026-01-29T04:21:32 +21ms service=bun cmd=["/home/prueba/.config/nvm/versions/node/v20.20.0/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode","add","@opencode-ai/plugin@1.1.41","--exact"] cwd=/home/prueba/.config/opencode running


Plugins

No response

OpenCode version

1.1.41

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

EndeavourOS (Arch Linux-based)

Terminal

Alacritty

Activity

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

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  3. nickwood commented on Jan 29, 2026

    @nickwood

    I've also been having a similar issues. I'm unable to spawn opencode in a directory with a .git subdirectory. Workaround was to run with the env_var OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true

    Full bug report (written with the help of opencode):

    Summary
    OpenCode 1.1.41 hangs indefinitely with a black screen when started in any directory containing a .git directory on Ubuntu 24.04 with kernel 6.14. The issue is caused by the Parcel file watcher's inotify subscription. Setting OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true resolves the issue.
    Environment

    • OpenCode version: 1.1.41
    • OS: Ubuntu 24.04.3 LTS (Noble Numbat)
    • Kernel: 6.14.0-1019-oem
    • Architecture: x86_64
    • Shell: zsh (with bash as system default)
    • libgit2: 1.7.2
    • Terminal: Tested in both Terminator and Konsole - same behavior
      Steps to Reproduce
    1. Install OpenCode 1.1.41 on Ubuntu 24.04 with kernel 6.14
    2. Navigate to any git repository, or create a fresh one:
      cd /tmp
      mkdir test-repo
      cd test-repo
      git init
      3. Run opencode
    3. Observe: Terminal goes completely black, no UI renders, process consumes CPU
      Expected Behavior
      OpenCode should start and display the TUI interface.
      Actual Behavior
    • Terminal goes completely black (no UI frame, no content)
    • Process enters a busy-wait loop (strace shows constant futex wake/wait + sched_yield)
    • opencode web also hangs
    • opencode run "message" also hangs
    • opencode debug config and opencode debug paths work correctly in git directories
      Workaround
      Setting the experimental flag resolves the issue:
      export OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true
      opencode
      Diagnostic Details
      What works:
    • OpenCode in non-git directories (~/.config, /tmp)
    • opencode debug config in git directories
    • opencode debug paths in git directories
    • Git operations themselves (git status, git fetch, etc.)
      What fails:
    • opencode (TUI) in any git directory
    • opencode web in any git directory
    • opencode run in any git directory
    • Even a fresh git init repo with no remote triggers the issue
      Log analysis:
      When running with --print-logs, output stops early at config loading phase. However, log files written to ~/.local/share/opencode/log/ show the backend initializes successfully up to VCS detection:
      INFO service=vcs branch=main initialized
      INFO service=file.watcher platform=linux backend=inotify watcher backend
      strace analysis:
      Running with strace shows the process enters a busy futex loop:
      futex(0x7817ab0d0164, FUTEX_WAKE_PRIVATE, 1) = 1
      futex(0x7817ab098164, FUTEX_WAKE_PRIVATE, 1) = 1
      sched_yield() = 0
      futex(0x7817ab0e8164, FUTEX_WAKE_PRIVATE, 1) = 1
      ... (repeats indefinitely)
      This pattern indicates a spinlock or livelock condition.
      Ruled out:
    • Git configuration (tested with empty ~/.gitconfig)
    • SSH configuration (git operations work fine)
    • Remote repositories (fresh git init with no remote fails)
    • OpenCode cache (cleared ~/.cache/opencode)
    • OpenCode config (tested with no opencode.jsonc)
    • inotify limits (65536 max_user_watches, only ~6000 in use)
    • Terminal emulator (same behavior in Terminator and Konsole)
      Suspected Root Cause
      Based on code review, the issue appears to be in packages/opencode/src/file/watcher.ts. When OpenCode detects a git repository, it:
    1. Initializes a Parcel watcher (@parcel/watcher) for the project directory
    2. Additionally subscribes to watch the .git directory to detect branch changes
      The inotify subscription (used on Linux) appears to cause a busy-wait condition on this kernel/system configuration. The watcher initialization only occurs when Instance.project.vcs === "git", which explains why non-git directories work fine.
      Additional Context
    • Other team members on the same OpenCode version do not experience this issue (different kernel versions suspected)
    • The OEM kernel 6.14.0-1019-oem may have different inotify behavior than standard kernels
  4. jara505 commented on Jan 30, 2026

    @jara505
    Author

    If you are experiencing a "Black Screen" hang ,the issue is a network deadlock caused by IPv6.

    The application (via the Bun/Node engine) gets stuck indefinitely trying to establish a connection over IPv6 that never receives a response. Disabling IPv6 forces the app to use IPv4, which resolves the initialization hang and allows the AI models to respond correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions