Skip to content

fix(shell): make envValue case-insensitive on all platforms#29380

Closed
SpencerJung wants to merge 2 commits into
anomalyco:devfrom
SpencerJung:fix/29290-shell-env-case-insensitive
Closed

fix(shell): make envValue case-insensitive on all platforms#29380
SpencerJung wants to merge 2 commits into
anomalyco:devfrom
SpencerJung:fix/29290-shell-env-case-insensitive

Conversation

@SpencerJung
Copy link
Copy Markdown

Fixes #29290. The envValue() function used case-sensitive process.env lookup on non-Windows platforms, but the expansion regex is case-insensitive. Remove the Windows-only check so envValue always performs a case-insensitive lookup.

The envValue() function used case-sensitive process.env lookup on non-Windows
platforms, but the $env: expansion regex is case-insensitive (/gi). This
caused mixed-case env var references like $env:Path to fail on Linux/macOS
when using pwsh, because process.env['Path'] returns undefined even when
process.env['PATH'] exists.

Remove the Windows-only check so envValue always performs a case-insensitive
lookup across all platforms.

Fixes anomalyco#29290
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential duplicates found:

  1. PR fix(shell): case-insensitive pwsh env var lookup (fixes #29290) #29371 - fix(shell): case-insensitive pwsh env var lookup (fixes #29290)

  2. PR fix(shell): case-insensitive env var lookup for pwsh on non-Windows #29287 - fix(shell): case-insensitive env var lookup for pwsh on non-Windows

Both PRs appear to be addressing the same underlying issue (case-insensitive environment variable lookups), particularly PR #29371 which directly references issue #29290 that your current PR also fixes.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 26, 2026
@github-actions github-actions Bot closed this May 26, 2026
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.

pwsh env var expansion fails with mixed-case env vars on non-Windows

1 participant