Add support for Nushell in shell builder (#33806)

We also swap out env variables before sending them to shells now in the
task system. This fixed issues Fish and Nushell had where an empty
argument could be sent into a command when no argument should be sent.
This only happened from task's generated by Zed.

Closes #31297 #31240

Release Notes:

- Fix bug where spawning a Zed generated task or debug session with Fish
or Nushell failed
This commit is contained in:
Anthony Eid 2025-07-08 10:57:37 -04:00 committed by GitHub
parent 0ca0914cca
commit bcac748c2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 123 additions and 8 deletions

View file

@ -256,7 +256,7 @@ impl TaskTemplate {
},
),
command: Some(command),
args: self.args.clone(),
args: args_with_substitutions,
env,
use_new_terminal: self.use_new_terminal,
allow_concurrent_runs: self.allow_concurrent_runs,
@ -642,11 +642,11 @@ mod tests {
assert_eq!(
spawn_in_terminal.args,
&[
"arg1 $ZED_SELECTED_TEXT",
"arg2 $ZED_COLUMN",
"arg3 $ZED_SYMBOL",
"arg1 test_selected_text",
"arg2 5678",
"arg3 010101010101010101010101010101010101010101010101010101010101",
],
"Args should not be substituted with variables"
"Args should be substituted with variables"
);
assert_eq!(
spawn_in_terminal.command_label,