diff --git a/crates/nu-system/src/macos.rs b/crates/nu-system/src/macos.rs index e6ae3d9ac..db7245034 100644 --- a/crates/nu-system/src/macos.rs +++ b/crates/nu-system/src/macos.rs @@ -303,12 +303,13 @@ impl ProcessInfo { /// Name of command pub fn name(&self) -> String { - self.command() - .split(' ') - .collect::>() - .first() - .map(|x| x.to_string()) - .unwrap_or_default() + // self.command() + // .split(' ') + // .collect::>() + // .first() + // .map(|x| x.to_string()) + // .unwrap_or_default() + self.command_only() } /// Full name of command, with arguments @@ -335,6 +336,19 @@ impl ProcessInfo { } } + /// Full name of comand only + pub fn command_only(&self) -> String { + if let Some(path) = &self.curr_path { + if !path.cmd.is_empty() { + path.exe.to_string_lossy().to_string() + } else { + String::from("") + } + } else { + String::from("") + } + } + /// Get the status of the process pub fn status(&self) -> String { let mut state = 7;