Skip to content

[Feature]: Setting to have the web ui running even without /pty-... command #60

Description

@BananaAcid

Problem Statement

"I'm always frustrated when..."

I try to reload the browser tab with the running sessions ... and page is not reachable.

even with my own shell script setting the port env, when opencode start ... and launches a pty session ... I manually must use /pty-... to be able to refresh the browser tab to see the sessions.

Proposed Solution

a config param (v1 -> env, v2 -> env+config) to have the pty web ui start on opencode use

Alternatives Considered

... doing it manual. But when the a task runs, until the /pty-... command is processed, it might take a while and I am not able to look at the output / not being able to input if something was needed on the console.

Use Case

Describe the use case(s) this feature would enable:

being able to interact with the pty session while a task is running, and the /pty-... is not yet being processed and thus the webui is not reachable.

Activity

  1. shekohex commented on Sep 18, 2026

    @shekohex
    Owner

    This feature is recently added in #59 I guess.

  2. BananaAcid commented on Sep 19, 2026

    @BananaAcid
    Author

    @shekohex it seems to be the exact feature, but as per https://github.com/shekohex/opencode-pty#environment-variables autostart is supported for V1

  3. kumar-shivang commented on Sep 19, 2026

    @kumar-shivang
    Contributor

    PR #59 introduced the autostart option specifically for OpenCode V2 through ctx.options.autostart in opencode.json, but did not include an environment variable or autostart for OpenCode V1 (where plugin options do not exist and configuration is handled via environment variables like PTY_WEB_PORT).

    I've opened #62 to address this:

    • Adds support for PTY_WEB_AUTOSTART (and alias PTY_AUTOSTART) environment variable accepting true, 1, yes, on.
    • Autostarts the PTY web server immediately during plugin setup in OpenCode V1 when enabled.
    • Falls back to PTY_WEB_AUTOSTART in OpenCode V2 if options.autostart is not explicitly set in config.
    • Documents PTY_WEB_AUTOSTART in the README under ### Environment Variables.

    With this, you can set export PTY_WEB_AUTOSTART=true (along with PTY_WEB_PORT) in your shell script and refresh your browser tab immediately on startup without needing to invoke slash commands.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions