You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nushell is not compatible with lowercase path on windows #12676
I've been told a few times that Windows Path isn't case-sensitive but case-preserving. So, if some crazy program makes it PaTh in those locations, Windows would probably use it. Seems like a bad idea to me to have anything except Path on Windows.
We do have 2 PRs that try and make env vars case-insensitive, but they've bit-rotted a bit. It would be good if someone resurrected one of them and close these type of issues once and for all.
@yizhepku ideally, in my perfect world, any case spelling of path would work everywhere throughout all nushell commands and custom command as well as across all operating systems that we support.
The problem I've seen recently is that HKCU will say path and HKLM will say Path. Having those two named different cause problems. I'm not sure how Windows works itself when they're different.
If Windows doesn't care, we must have a bug in Nushell then. I thought we fixed that making it case insensitive but if the HKLM and HKCU are different it makes for problems. I guess it could be the rust implementation because I don't think we query any registry keys directly to get the path.
Activity
fdncred commentedon Apr 26, 2024
If either of these commands returns
pathvsPathon Windows, then that is a problem. I've seen it before.I've been told a few times that Windows Path isn't case-sensitive but case-preserving. So, if some crazy program makes it
PaThin those locations, Windows would probably use it. Seems like a bad idea to me to have anything exceptPathon Windows.We do have 2 PRs that try and make env vars case-insensitive, but they've bit-rotted a bit. It would be good if someone resurrected one of them and close these type of issues once and for all.
yizhepku commentedon May 10, 2024
Now that #12701 has landed, what do we think of this? Do we want to support this specific use case?
Currently,
$env.pathworks, but thewhichcommand doesn't work because it usesnu_engine::env::path_str(), which fetchesPathorPATHbut notpath.fdncred commentedon May 10, 2024
@yizhepku ideally, in my perfect world, any case spelling of path would work everywhere throughout all nushell commands and custom command as well as across all operating systems that we support.
fdncred commentedon Nov 14, 2024
The problem I've seen recently is that HKCU will say
pathand HKLM will sayPath. Having those two named different cause problems. I'm not sure how Windows works itself when they're different.ChrisDenton commentedon Nov 14, 2024
Windows doesn't care. Here's a silly program that illustrates how this works on Windows: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9c6ab81e8fdcb28e455ab8b6055f03b1
fdncred commentedon Nov 14, 2024
If Windows doesn't care, we must have a bug in Nushell then. I thought we fixed that making it case insensitive but if the HKLM and HKCU are different it makes for problems. I guess it could be the rust implementation because I don't think we query any registry keys directly to get the path.
ChrisDenton commentedon Nov 14, 2024
From my reading, Nushell didn't make it case insensitive, it just added a fallback for
Path. So any other case will fail.nushell/crates/nu-engine/src/env.rs
Lines 217 to 218 in 636bae2
fdncred commentedon Nov 14, 2024
Good point. We must of only made it that way in the repl and scripts because this works fine.
add function to make env vars case-insensitive (nushell#14390)