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:
@@ -197,7 +197,7 @@ impl Project {
|
||||
)?,
|
||||
},
|
||||
None => match activation_script.clone() {
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
#[cfg(not(windows))]
|
||||
activation_script if !activation_script.is_empty() => {
|
||||
let activation_script = activation_script.join("; ");
|
||||
let to_run = if let Some(command) = spawn_task.command {
|
||||
@@ -214,7 +214,25 @@ impl Project {
|
||||
program: shell,
|
||||
args: vec![
|
||||
"-c".to_owned(),
|
||||
format!("{activation_script}; {to_run}",),
|
||||
// alacritty formats all args into a single string literally without extra quoting before handing it off to powershell
|
||||
// so we work around this here
|
||||
if cfg!(windows) {
|
||||
println!(
|
||||
"{}",
|
||||
shlex::try_quote(&format!(
|
||||
"{activation_script}; {to_run}",
|
||||
))
|
||||
.unwrap()
|
||||
.into_owned()
|
||||
);
|
||||
shlex::try_quote(&format!(
|
||||
"{activation_script}; {to_run}",
|
||||
))
|
||||
.unwrap()
|
||||
.into_owned()
|
||||
} else {
|
||||
format!("{activation_script}; {to_run}",)
|
||||
},
|
||||
],
|
||||
title_override: None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user