[Feature]: Setting to have the web ui running even without /pty-... command
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.
This feature is recently added in #59 I guess.
@shekohex it seems to be the exact feature, but as per https://github.com/shekohex/opencode-pty#environment-variables autostart is supported for V1
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 aliasPTY_AUTOSTART) environment variable acceptingtrue,1,yes,on. - Autostarts the PTY web server immediately during plugin setup in OpenCode V1 when enabled.
- Falls back to
PTY_WEB_AUTOSTARTin OpenCode V2 ifoptions.autostartis not explicitly set in config. - Documents
PTY_WEB_AUTOSTARTin 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.