diff --git a/src/cli/exec.rs b/src/cli/exec.rs index 73a9756c3..a39a30ec9 100644 --- a/src/cli/exec.rs +++ b/src/cli/exec.rs @@ -120,7 +120,15 @@ fn parse_command( (Some(command), _) => { let (program, args) = command.split_first().unwrap(); - (program.clone(), args.into()) + if cfg!(windows) { + let args = vec!["/c".into(), program.into()] + .into_iter() + .chain(args.iter().cloned()) + .collect(); + (shell.into(), args) + } else { + (program.clone(), args.into()) + } } _ => (shell.into(), vec!["-c".into(), c.clone().unwrap()]), } diff --git a/src/env.rs b/src/env.rs index ba8bbd104..535ab8860 100644 --- a/src/env.rs +++ b/src/env.rs @@ -18,7 +18,10 @@ use crate::file::replace_path; use crate::hook_env::{deserialize_watches, HookEnvWatches}; pub static ARGS: RwLock> = RwLock::new(vec![]); +#[cfg(unix)] pub static SHELL: Lazy = Lazy::new(|| var("SHELL").unwrap_or_else(|_| "sh".into())); +#[cfg(windows)] +pub static SHELL: Lazy = Lazy::new(|| var("COMSPEC").unwrap_or_else(|_| "cmd.exe".into())); // paths and directories #[cfg(test)] diff --git a/src/plugins/core/mod.rs b/src/plugins/core/mod.rs index 6de4c2d6d..76323a265 100644 --- a/src/plugins/core/mod.rs +++ b/src/plugins/core/mod.rs @@ -62,7 +62,7 @@ pub static CORE_PLUGINS: Lazy = Lazy::new(|| { Arc::new(RubyPlugin::new()), ]; #[cfg(windows)] - let mut plugins: Vec> = vec![ + let plugins: Vec> = vec![ // Arc::new(BunPlugin::new()), // Arc::new(DenoPlugin::new()), // Arc::new(ErlangPlugin::new()),