Properly pass nested script arguments for tasks (#10776)

Closes
https://github.com/zed-industries/zed/discussions/10732#discussion-6524347
introduced by https://github.com/zed-industries/zed/pull/10548 while
keeping both Python and Bash run selection capabilities.

Also replaced redundant `SpawnTask` struct with `SpawnInTerminal` that
has identical fields.

Release Notes:

- Fixed incorrect task escaping of nested script arguments

---------

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
This commit is contained in:
Kirill Bulatov 2024-04-19 16:24:35 +03:00 committed by GitHub
parent 9247da77a3
commit 13c17267b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 55 additions and 85 deletions

View file

@ -186,13 +186,7 @@ pub(super) fn python_task_context() -> ContextProviderWithTasks {
TaskTemplate {
label: "execute selection".to_owned(),
command: "python3".to_owned(),
args: vec![
"-c".to_owned(),
format!(
"exec(r'''{}''')",
VariableName::SelectedText.template_value()
),
],
args: vec!["-c".to_owned(), VariableName::SelectedText.template_value()],
ignore_previously_resolved: true,
..TaskTemplate::default()
},