diff --git a/pty/src/cmdbuilder.rs b/pty/src/cmdbuilder.rs index 837d325f5..845ba73ef 100644 --- a/pty/src/cmdbuilder.rs +++ b/pty/src/cmdbuilder.rs @@ -439,11 +439,11 @@ impl CommandBuilder { } pub fn get_shell(&self) -> anyhow::Result { - Ok(self + let exe: OsString = self .get_env("ComSpec") .unwrap_or(OsStr::new("cmd.exe")) - .into() - .into_string()?) + .into(); + Ok(exe.into_string()?) } pub(crate) fn cmdline(&self) -> anyhow::Result<(Vec, Vec)> {