Forward Fork AskPass variables through WSL#156
Open
camjac251 wants to merge 1 commit into
Open
Conversation
Share Fork's credential-prompt variables only when Fork is active. Mark Windows path values with WSLENV /p translation and normalize existing entries to avoid duplicate or conflicting flags.
camjac251
marked this pull request as ready for review
July 17, 2026 22:09
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.
Summary
invoked by Fork.
WSLENVentries while normalizing existing entriesfor the forwarded variables.
Problem
Fork can invoke wslgit with an AskPass executable configured while wslgit
runs Git inside WSL. Existing Windows process variables are not imported by
WSL unless they are registered in
WSLENV, and Windows path values also needWSL's
/ptranslation flag.As a result, Git and its credential-prompt process cannot reliably consume
Fork's existing AskPass and repository context inside WSL.
Implementation
Forward only this allowlist when
FORK_PROCESS_IDindicates that wslgit wasstarted by Fork:
FORK_PROCESS_IDSSH_ASKPASS_REQUIRENO_PROMPTFORK_REPOSITORY_PATHSSH_ASKPASSFORK_REPOSITORY_PATHandSSH_ASKPASSare registered with theWSLENV/pflag because they contain Windows paths. The other three variables areforwarded without path translation.
Only variables already present in the process environment are registered.
Existing entries for the same key are matched case-insensitively and
normalized to one entry with the required flags. Unrelated
WSLENVentriesremain in their original order.
Verification
cargo fmt --all -- --checkgit diff --check develop...HEADWSLENVnormalization unit test: 1 passed, 0 failed.shell_environment_variabletest: 32 passed, 0 failed, 1 filtered.The excluded upstream test expects the inherited
SHELLvalue to contain/bin/bash; this environment supplies/usr/bin/zsh. The test is unchangedand fails on this branch for that reason. Strict Clippy is also blocked by 28
warnings in unchanged upstream lines; the new lines were not among the
reported locations.
Compatibility
WSLENV.WSLENVentries are preserved.configuration, or the AskPass executable itself.
Related issues
Related to #151.
That report also contains an invalid-handle error and WSL startup diagnostics.
This change only addresses Fork credential-prompt environment forwarding and
does not claim to resolve those separate failure modes.