task: Wrap programs in ""s (#31537)
This commit effectively re-implements #21981 in task system. commands with spaces cannot be spawned currently, and we don't want to have to deal with shell variables wrapped in "" in DAP locators. Closes #ISSUE Release Notes: - Fixed an issue where tasks with spaces in `command` field could not be spawned.
This commit is contained in:
parent
b63cea1f17
commit
5db14d315b
2 changed files with 2 additions and 4 deletions
|
@ -382,10 +382,7 @@ impl ContextProvider for PythonContextProvider {
|
|||
toolchains
|
||||
.active_toolchain(worktree_id, Arc::from("".as_ref()), "Python".into(), cx)
|
||||
.await
|
||||
.map_or_else(
|
||||
|| "python3".to_owned(),
|
||||
|toolchain| format!("\"{}\"", toolchain.path),
|
||||
)
|
||||
.map_or_else(|| "python3".to_owned(), |toolchain| toolchain.path.into())
|
||||
} else {
|
||||
String::from("python3")
|
||||
};
|
||||
|
|
|
@ -384,6 +384,7 @@ impl ShellBuilder {
|
|||
|
||||
/// Returns the program and arguments to run this task in a shell.
|
||||
pub fn build(mut self, task_command: String, task_args: &Vec<String>) -> (String, Vec<String>) {
|
||||
let task_command = format!("\"{task_command}\"");
|
||||
let combined_command = task_args
|
||||
.into_iter()
|
||||
.fold(task_command, |mut command, arg| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue