project: Fix terminal activation scripts failing on Windows for new shells (#37986)

Tasks are still disabled as there seem to be more issues with it

Release Notes:

- N/A
This commit is contained in:
Lukas Wirth
2025-09-11 12:16:08 +00:00
committed by GitHub
parent 6ae83b4740
commit 4002602a89
7 changed files with 38 additions and 43 deletions
+6 -3
View File
@@ -918,9 +918,12 @@ impl ToolchainLister for PythonToolchainProvider {
ShellKind::Cmd => "activate.bat",
};
let path = prefix.join(BINARY_DIR).join(activate_script_name);
if fs.is_file(&path).await {
activation_script
.push(format!("{activate_keyword} \"{}\"", path.display()));
if let Ok(quoted) =
shlex::try_quote(&path.to_string_lossy()).map(Cow::into_owned)
&& fs.is_file(&path).await
{
activation_script.push(format!("{activate_keyword} {quoted}"));
}
}
}