Skip to content

Comments

fix(ProcessManager): Linux home UI loading issue#23

Closed
magicJie wants to merge 1 commit intomtymek:mainfrom
magicJie:main
Closed

fix(ProcessManager): Linux home UI loading issue#23
magicJie wants to merge 1 commit intomtymek:mainfrom
magicJie:main

Conversation

@magicJie
Copy link

@magicJie magicJie commented Feb 5, 2026

Summary

Fixes the issue where the OpenCode home UI cannot be loaded on Linux due to missing environment variables (especially PATH).

Problem

On Linux, spawning the OpenCode process directly doesn't inherit the user's shell environment, causing the server to fail to start properly.

Solution

Use an interactive login shell (/bin/bash -i -l) to spawn the process on non-Windows platforms:

  • Linux/macOS: Use /bin/bash -i -l -c command to load the user's full environment (including PATH from .bashrc/.zshrc)
  • Windows: Keep the original shell: true approach for .cmd file compatibility

Changes

  • Platform-specific spawn logic in ProcessManager.start()
  • Added environment variables (HOME, SHELL, TERM, XDG_CONFIG_HOME) for Linux/macOS
  • Proper detached flag handling (false on Windows, true on Unix)

Testing

  • Tested on Linux - server starts correctly, UI loads
  • Windows compatibility preserved

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant