-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uv venv's activate command cannot work on MSYS2 #4984
Comments
Thanks! Looks like we need to display a posix style path here, it should be relatively easy to fix? |
Considering something like diff --git a/crates/uv/src/commands/venv.rs b/crates/uv/src/commands/venv.rs
index cb906898..7e669ead 100644
--- a/crates/uv/src/commands/venv.rs
+++ b/crates/uv/src/commands/venv.rs
@@ -312,7 +312,7 @@ async fn venv_impl(
/// Quote a path, if necessary, for safe use in a POSIX-compatible shell command.
fn shlex_posix(executable: impl AsRef<Path>) -> String {
// Convert to a display path.
- let executable = executable.as_ref().user_display().to_string();
+ let executable = executable.as_ref().portable_display().to_string();
// Like Python's `shlex.quote`:
// > Use single quotes, and put single quotes into double quotes but I'm a little confused that |
Yes, if msys2 is found, directly printing a POSIX-style path is fine. |
Is this one still up for grabs? If so I'd like to take a stab at it |
I think I might have fixed this |
Yeah, #5956 — sorry. |
No problem, I'll look around for something else to tackle |
Steps to Reproduce
At MSYS2, run the following command:
Suggested Fix
Use the correct path to activate the virtual environment:
source .venv/Scripts/activate
Environment Details
The text was updated successfully, but these errors were encountered: