Skip to content

fix(env): use OS path separator for path-list env vars on Windows#9058

Merged
jdx merged 1 commit intojdx:mainfrom
richardthe3rd:claude/fix-windows-env-parsing-x7S9J
Apr 15, 2026
Merged

fix(env): use OS path separator for path-list env vars on Windows#9058
jdx merged 1 commit intojdx:mainfrom
richardthe3rd:claude/fix-windows-env-parsing-x7S9J

Conversation

@richardthe3rd
Copy link
Copy Markdown
Contributor

@richardthe3rd richardthe3rd commented Apr 11, 2026

This pull request standardizes how environment variables that represent lists of file system paths are parsed, ensuring they use the OS-native path separator (: on Unix, ; on Windows) instead of always using a colon. This change improves cross-platform compatibility, particularly for Windows users, and updates documentation, configuration schemas, and tests accordingly.

Core logic and parsing improvements:

  • Introduced a new list_by_os_path_separator parser that uses the OS-native path separator for environment variables representing path lists, replacing the previous colon-based parsing logic. This is implemented in src/config/settings.rs and thoroughly tested. [1] [2]
  • Updated environment variable parsing in src/env.rs for MISE_IGNORED_CONFIG_PATHS and MISE_CEILING_PATHS to use var_os and split_paths, ensuring correct handling of Windows paths. [1] [2]

Configuration and schema updates:

  • Modified settings.toml to use list_by_os_path_separator for relevant settings (MISE_TRUSTED_CONFIG_PATHS, MISE_IGNORED_CONFIG_PATHS, MISE_CEILING_PATHS, MISE_SHARED_INSTALL_DIRS, MISE_TASK_DISABLE_PATHS), and clarified documentation to specify the OS-native path separator. [1] [2] [3] [4] [5]
  • Updated JSON schemas and documentation to reflect the new parsing behavior and clarify the use of the OS path separator in environment variables. [1] [2] [3] [4]

Testing improvements:

  • Added new end-to-end tests for trusted and ignored config paths on both Unix (e2e/cli/test_trusted_config_paths, e2e/config/test_config_ignored_paths) and Windows (e2e-win/trusted_config_paths.Tests.ps1) to verify correct parsing and behavior with both single and multiple paths. [1] [2] [3]

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates environment variable path-list parsing to use OS-native separators (':' on Unix, ';' on Windows), improving Windows compatibility for settings like MISE_TRUSTED_CONFIG_PATHS. It includes documentation updates, new E2E tests, and a list_by_os_path_separator helper. A review comment suggests adding tilde expansion to this helper for consistent path resolution.

Comment thread src/config/settings.rs
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 11, 2026

Greptile Summary

This PR fixes Windows path parsing for five path-list env vars (MISE_TRUSTED_CONFIG_PATHS, MISE_IGNORED_CONFIG_PATHS, MISE_CEILING_PATHS, MISE_SHARED_INSTALL_DIRS, MISE_TASK_DISABLE_PATHS) by switching from a hardcoded : split to std::env::split_paths, which uses ; on Windows and : on Unix. The core logic, unit tests, e2e tests (Unix + Windows), schema, and setting descriptions are all updated consistently — the only gap is docs/settings.data.ts, which isn't updated to recognise the new parser name and will silently drop the separator badge from the rendered docs for those five settings.

Confidence Score: 5/5

Safe to merge; the one remaining finding is a minor docs display regression with no runtime impact.

All runtime changes are correct and well-tested (unit tests for both platforms, Unix e2e, Windows Pester). The only gap is that docs/settings.data.ts doesn't map list_by_os_path_separator to a display string, causing five settings to lose their "(colon separated)" badge in the docs. This is purely cosmetic — the setting descriptions themselves already explain the separator — and does not affect behavior.

docs/settings.data.ts — getParseEnv needs a case for list_by_os_path_separator

Important Files Changed

Filename Overview
docs/settings.data.ts Not updated to handle list_by_os_path_separator; getParseEnv returns undefined for this value, dropping the separator indicator in rendered docs for all 5 migrated settings.
src/config/settings.rs Adds list_by_os_path_separator parser using std::env::split_paths; comprehensive unit tests cover empty, single, multi-path (Unix and Windows), and BTreeSet collection cases.
src/env.rs Switches MISE_IGNORED_CONFIG_PATHS from var()/split(':') to var_os()/split_paths(), making it consistent with MISE_CEILING_PATHS which already used split_paths.
settings.toml Migrates 5 path-list settings from list_by_colon to list_by_os_path_separator; descriptions updated to call out the OS-native separator.
e2e-win/trusted_config_paths.Tests.ps1 New Windows Pester test verifying single-path and semicolon-separated multi-path trusted config via MISE_TRUSTED_CONFIG_PATHS.
e2e/cli/test_trusted_config_paths New E2E test verifying single and multi-path trusted config on Unix using the standard assert_contains helper.
e2e/config/test_config_ignored_paths New E2E test verifying single and multi-path ignored config on Unix with both positive and negative assertions using standard helpers.
docs/configuration.md Updates MISE_TRUSTED_CONFIG_PATHS doc to clarify the platform-specific separator.
schema/mise-settings.json Adds list_by_os_path_separator to the allowed enum for parse_env in the JSON schema.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Env var e.g. MISE_TRUSTED_CONFIG_PATHS] --> B{Source}
    B -->|env.rs early-init| C["var_os() → OsString"]
    B -->|confique / settings.rs| D["parse_env = list_by_os_path_separator(str)"]
    C --> E["std::env::split_paths()"]
    D --> F["std::env::split_paths()"]
    E --> G{Platform}
    F --> G
    G -->|Unix| H["Split on ':'"]
    G -->|Windows| I["Split on ';'"]
    H --> J["Vec<PathBuf> / BTreeSet<PathBuf>"]
    I --> J
Loading

Reviews (11): Last reviewed commit: "fix(env): use OS path separator for path..." | Re-trigger Greptile

Comment thread e2e/cli/test_trusted_config_paths Outdated
@richardthe3rd richardthe3rd marked this pull request as draft April 12, 2026 09:04
@richardthe3rd richardthe3rd force-pushed the claude/fix-windows-env-parsing-x7S9J branch from 381283a to 50a0ab2 Compare April 12, 2026 17:03
@richardthe3rd richardthe3rd marked this pull request as ready for review April 12, 2026 19:37
On Windows, absolute paths contain `:` in drive letters (e.g. C:\foo),
making `:` the wrong separator for PATH-like environment variable lists.
Switch to `std::env::split_paths` / `std::env::join_paths`, which use
`;` on Windows and `:` on Unix.

Affected env vars: MISE_CEILING_PATHS, MISE_TRUSTED_CONFIG_PATHS,
MISE_IGNORED_CONFIG_PATHS, MISE_TASK_DISABLE_PATHS, MISE_SHARED_INSTALL_DIRS.

Also: document the OS path separator in each setting's description, update
the schema, add e2e tests for the Unix (`:`) and Windows (`;`) separators,
and use var_os/split_paths consistently for all five env vars.

https://claude.ai/code/session_01S18fPa26YAPQJDp3dnmW77
@richardthe3rd richardthe3rd force-pushed the claude/fix-windows-env-parsing-x7S9J branch from 50a0ab2 to d24ef59 Compare April 15, 2026 21:27
@jdx jdx merged commit 91b57af into jdx:main Apr 15, 2026
35 checks passed
mise-en-dev added a commit that referenced this pull request Apr 16, 2026
### 🐛 Bug Fixes

- **(env)** use OS path separator for path-list env vars on Windows by
@richardthe3rd in [#9058](#9058)
- check all github token sources in 403 rate limit warning by @jdx in
[#9121](#9121)

### 📚 Documentation

- add settings section for java by @roele in
[#9126](#9126)

### 📦 Registry

- added podlet by @tony-sol in
[#9134](#9134)
- add maturin by @Bing-su in
[#9113](#9113)

### New Contributors

- @Bing-su made their first contribution in
[#9113](#9113)

## 📦 Aqua Registry Updates

#### Updated Packages (2)

- [`fwdcloudsec/granted`](https://github.com/fwdcloudsec/granted)
- [`watchexec/watchexec`](https://github.com/watchexec/watchexec)
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.

3 participants