fix(env): force uppercase PATH key on unix#9927
Conversation
Greptile SummaryThis PR fixes a regression where mise would use a lowercase
Confidence Score: 5/5Targeted, well-tested fix with no risk to existing behaviour on either platform. The change is narrow: a two-branch platform split replaces a single fragile heuristic. The Unix branch ignores its input by design, the Windows branch is functionally identical to the original. Both paths are covered by new unit tests that directly exercise the regression scenario. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/zsh-path-ke..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request refactors the PATH_KEY initialization in src/env.rs to handle platform-specific environment variable casing, specifically ensuring that Windows preserves the original casing of the path variable. It also adds unit tests for both Unix and Windows implementations. Feedback was provided to optimize the environment variable iteration by using vars_os() instead of vars_safe(), which avoids unnecessary string allocations for values and prevents potential issues where the path variable might be skipped due to invalid UTF-8 content.
Summary
PATHon Unix so zsh activation/hook output cannot use lowercasepathpathhandlingAddresses discussion #9925.
Tests
cargo fmt --checkcargo test env::tests::test_path_key_from_env_uses_uppercase_path_on_unix