Bash permission prompt doesn't expand shell variables in path detection

Resolved 💬 2 comments Opened Mar 19, 2026 by mtschoen-unity Closed Apr 16, 2026

When a Bash command references a path using a shell variable (e.g. $USERPROFILE), the permission prompt's "always allow" option shows the variable as a literal path segment instead of expanding it.

Example command:

rm -rf "$USERPROFILE/foo" 2>/dev/null; echo "Done"

Permission prompt shows:

Yes, and always allow access to C:\workdir\$USERPROFILE\foo\ from this project

Expected: The path should resolve to something like C:\Users\<username>\foo\, or the "always allow" option should not be offered when the path can't be reliably resolved.

Actual: $USERPROFILE is treated as a literal directory name relative to the working directory, producing a nonsensical path. Accepting the rule creates an allow entry that will never match future commands.

Environment:

  • Platform: Windows
  • Shell: Bash (Git Bash / MSYS2)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗