util: Fix shell kind in windows based on program path (#39696)
Closes #39614 The `ShellKind` struct is built on Windows' side, meaning that when connecting to remotes, we fall back to PowerShell construction, even if the shell program we are spawning is a unix program. This broke tasks creation since we are using the shell kind to construct args: https://github.com/zed-industries/zed/blob/d04ac864b8cb78ee888ce03323e34c17a6dd16b9/crates/project/src/terminals.rs#L149 In normal terminals this only affected activation scripts (only place where shell kind is used) I don't have a Windows machine to test it, so I would appreciate any help with testing! Release Notes: - Fixed an issue where tasks could not be executed in Windows WSL --------- Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
This commit is contained in:
@@ -2391,8 +2391,8 @@ mod tests {
|
||||
cx.executor().allow_parking();
|
||||
|
||||
let (completion_tx, completion_rx) = smol::channel::unbounded();
|
||||
let (program, args) =
|
||||
ShellBuilder::new(&Shell::System).build(Some("echo".to_owned()), &["hello".to_owned()]);
|
||||
let (program, args) = ShellBuilder::new(&Shell::System, false)
|
||||
.build(Some("echo".to_owned()), &["hello".to_owned()]);
|
||||
let terminal = cx.new(|cx| {
|
||||
TerminalBuilder::new(
|
||||
None,
|
||||
@@ -2510,7 +2510,7 @@ mod tests {
|
||||
cx.executor().allow_parking();
|
||||
|
||||
let (completion_tx, completion_rx) = smol::channel::unbounded();
|
||||
let (program, args) = ShellBuilder::new(&Shell::System)
|
||||
let (program, args) = ShellBuilder::new(&Shell::System, false)
|
||||
.build(Some("asdasdasdasd".to_owned()), &["@@@@@".to_owned()]);
|
||||
let terminal = cx.new(|cx| {
|
||||
TerminalBuilder::new(
|
||||
|
||||
Reference in New Issue
Block a user