Repository navigation
🐛 fix(activate): keep Git Bash PATH after cmd - #3669
Merged
gaborbernat merged 1 commit intoNov 20, 2026
Merged
Conversation
gaborbernat
force-pushed
the
fix/3638-bash-cross-shell-path
branch
4 times, most recently
from
November 20, 2026 09:11
fd90491 to
cf52fa3
Compare
Discard a batch PATH backup when activation starts in a new Bash shell. Keep Bash's own backup when activating again in the same shell. Fixes pypa#3638
gaborbernat
force-pushed
the
fix/3638-bash-cross-shell-path
branch
from
November 20, 2026 10:45
cf52fa3 to
bac953c
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 12:03
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.
When batch activation saves a Windows PATH backup, Git Bash inherits it as
_OLD_VIRTUAL_PATH. Bash activation then restores that backup before setting its own PATH, leaving a semicolon-separated Windows list where Bash expects a colon-separated list. Commands such asunameandbasenamecannot be found. The Bash activation script now keeps Git Bash's PATH during this handoff. Fixes #3638.Batch backup crossed into Git Bash
The batch script exports its saved PATH to child processes. A new Git Bash session has no
deactivatefunction from a prior Bash activation, so the Bash script discards the inherited backup before its initial cleanup. A Bash session that already has adeactivatefunction keeps its own backup for reactivation. The Windows integration test starts incmd.exe, calls batch activation, launches Git Bash, and checks command lookup and PATH after Bash deactivation.Behavior changes
Git Bash can activate after batch activation without losing command lookup, and Bash deactivation restores the PATH Git Bash had on entry. Existing batch activation and same-shell Bash reactivation keep their PATH restoration behavior. This does not change other environment variables inherited from
cmd.exe.Reported by oss-scanner: ANT-2026-R2DNTJGS.