From b87e32e91da9405cc6b07b946cd1433d83b020eb Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sun, 14 Jun 2020 18:01:35 +0200 Subject: [PATCH] Update WSL call to use bash instead of wsl command --- src/extension/shell.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/extension/shell.rs b/src/extension/shell.rs index 7ffcffa..09ec1ad 100644 --- a/src/extension/shell.rs +++ b/src/extension/shell.rs @@ -34,6 +34,7 @@ pub enum Shell { Cmd, Powershell, WSL, + WSL2, Bash, Sh, } @@ -52,6 +53,11 @@ impl Shell { command }, Shell::WSL => { + let mut command = Command::new("bash"); + command.args(&["-c", &cmd]); + command + }, + Shell::WSL2 => { let mut command = Command::new("wsl"); command.args(&["bash", "-c", &cmd]); command @@ -79,6 +85,7 @@ impl Shell { "cmd" => Some(Shell::Cmd), "powershell" => Some(Shell::Powershell), "wsl" => Some(Shell::WSL), + "wsl2" => Some(Shell::WSL2), "bash" => Some(Shell::Bash), "sh" => Some(Shell::Sh), _ => None,