Skip to content

TUI hangs on a blank screen when --port is already in use #54934

Closed as not planned

Description

@Nowaker

Description

opencode --port 4096 with port 4096 already in use never starts and never says why: the terminal stays blank until you kill opencode.

The TUI asks its server worker to start the listener over the internal RPC channel (packages/opencode/src/util/rpc.ts). Server.listen rejects, but Rpc.listen posts a reply only when the method returns, and the worker swallows the rejection, so the TUI waits for that reply forever. Any other worker request whose handler throws hangs the TUI the same way.

Plugins

none

OpenCode version

1.19.0 (v1 at dfb56f7)

Steps to reproduce

  1. Take a port: python3 -m http.server 4096 --bind 127.0.0.1
  2. In another terminal: opencode --port 4096
  3. The screen stays blank and opencode keeps running; nothing is printed.

Expected: opencode exits with an error saying the port is in use.

Operating System

Arch Linux

Terminal

tmux

This is AI generated, but under direct supervision and on request of @Nowaker.

Activity

  1. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and root-cause analysis, @Nowaker.

    This is in OpenCode v1 (1.19.0), which now only gets fixes for critical bugs: data loss, security problems, or breakage with no workaround. This hang can be avoided by freeing the port or choosing a different --port, so it's unlikely to be fixed in v1.

    We'd encourage you to try v2 (@opencode/cli). It's a separate implementation in which the CLI starts a managed service, and that service checks for EADDRINUSE and reports that the port is already in use. In case they're useful, these v2 issues are related:

    If you think this is critical, or you can reproduce it on v2, please reply here with the details.

  2. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    We haven't heard back, so I'm closing this as not planned. The hang when --port is already in use is in OpenCode v1 (1.19.0), which only gets critical fixes. Freeing the port or choosing a different --port avoids it. v2 (@opencode/cli) handles a port that's already in use differently and reports an error. If you can reproduce this on v2, please open a new issue or reply here with the details. Thanks for the thorough report, @Nowaker.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions