Agent Diagnostic
Loaded skill: create-github-issue. Ran codebase-wide grep for HOME env var usage.
Findings: The CLI (and core path resolution) unconditionally reads HOME, which does not exist on Windows (Windows uses USERPROFILE, HOMEDRIVE/HOMEPATH). Key call sites:
| File |
Line(s) |
Usage |
crates/openshell-core/src/paths.rs |
23, 41, 59 |
xdg_config_dir(), xdg_state_dir(), xdg_data_dir() — all error with "HOME is not set" |
crates/openshell-cli/src/run.rs |
738 |
std::env::var_os("HOME") fallback for XDG_STATE_HOME |
crates/openshell-cli/src/run.rs |
4354-4355 |
gcloud ADC file resolution — errors with "HOME is not set" |
crates/openshell-cli/src/ssh.rs |
1457-1459 |
SSH config path — errors with "HOME is not set" |
crates/openshell-core/src/config.rs |
164, 219 |
Podman/Docker socket candidates |
crates/openshell-providers/src/providers/opencode.rs |
21-28 |
opencode_config_path() fallback |
crates/openshell-server/src/compute/vm.rs |
238 |
Driver search directory |
crates/openshell-driver-vm/src/driver.rs |
3232 |
macOS podman socket path |
No USERPROFILE, HOMEDRIVE, or HOMEPATH handling exists anywhere in the codebase. The entire XDG path-resolution layer assumes a Unix-like HOME.
Description
Actual behavior: Running openshell on Windows fails immediately because std::env::var("HOME") returns an error. The HOME environment variable is not set by default on Windows — Windows uses USERPROFILE (e.g., C:\Users\<name>) instead.
Expected behavior: The CLI should resolve the user's home directory on all supported platforms, falling back to USERPROFILE on Windows (or using Rust's dirs::home_dir() / std::env::home_dir()).
Reproduction Steps
- Install OpenShell on Windows
- Run any
openshell CLI command (e.g., openshell --help or openshell sandbox create)
- Observe error: "HOME is not set"
Environment
- OS: Windows 11 Pro 10.0.26100
- Docker: N/A (crash occurs before Docker interaction)
- OpenShell: main branch (commit 7e0cce4)
Logs
Agent Diagnostic
Loaded skill:
create-github-issue. Ran codebase-wide grep forHOMEenv var usage.Findings: The CLI (and core path resolution) unconditionally reads
HOME, which does not exist on Windows (Windows usesUSERPROFILE,HOMEDRIVE/HOMEPATH). Key call sites:crates/openshell-core/src/paths.rsxdg_config_dir(),xdg_state_dir(),xdg_data_dir()— all error with "HOME is not set"crates/openshell-cli/src/run.rsstd::env::var_os("HOME")fallback forXDG_STATE_HOMEcrates/openshell-cli/src/run.rscrates/openshell-cli/src/ssh.rscrates/openshell-core/src/config.rscrates/openshell-providers/src/providers/opencode.rsopencode_config_path()fallbackcrates/openshell-server/src/compute/vm.rscrates/openshell-driver-vm/src/driver.rsNo
USERPROFILE,HOMEDRIVE, orHOMEPATHhandling exists anywhere in the codebase. The entire XDG path-resolution layer assumes a Unix-likeHOME.Description
Actual behavior: Running
openshellon Windows fails immediately becausestd::env::var("HOME")returns an error. TheHOMEenvironment variable is not set by default on Windows — Windows usesUSERPROFILE(e.g.,C:\Users\<name>) instead.Expected behavior: The CLI should resolve the user's home directory on all supported platforms, falling back to
USERPROFILEon Windows (or using Rust'sdirs::home_dir()/std::env::home_dir()).Reproduction Steps
openshellCLI command (e.g.,openshell --helporopenshell sandbox create)Environment
Logs