Fix loading shell environment on Windows#21619
Merged
niik merged 1 commit intodevelopmentfrom Feb 13, 2026
Merged
Conversation
Replace fixed start/end marker strings with CRLF-tolerant regexes, locate the start marker via match and the last end marker via matchAll/at(-1), and update substring extraction accordingly. This prevents mis-parsing when shells emit extra stdout or use CRLF line endings and provides clearer error messages when markers are missing.
sergiou87
approved these changes
Feb 13, 2026
Member
sergiou87
left a comment
There was a problem hiding this comment.
LGTM. Not needed for this PR, but… could we add some test coverage for this in a future PR? 🤔
Member
Author
|
Yo @copilot, could you make a PR that does a smoke test of getShellEnv? We just want to make sure it it able to execute on both macOS and Windows. On Windows we should make sure that it works for all possible values of shellKind (i.e 'git-bash', 'pwsh', 'powershell', and 'cmd') and on macOS passing undefined should suffice. It'd be neat if we could get away with just one test that conditionalizes the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace fixed start/end marker strings with CRLF-tolerant regexes, locate the start marker via match and the last end marker via matchAll/at(-1), and update substring extraction accordingly. This prevents mis-parsing when shells emit extra stdout or use CRLF line endings and provides clearer error messages when markers are missing.
Screenshots
Release notes
Notes: [Fixed] Account for Windows EOL formatting when loading shell environment