diff --git a/crates/nu-command/src/system/ps.rs b/crates/nu-command/src/system/ps.rs index 5ebf21b3b..071366440 100644 --- a/crates/nu-command/src/system/ps.rs +++ b/crates/nu-command/src/system/ps.rs @@ -86,6 +86,12 @@ fn run_ps(engine_state: &EngineState, call: &Call) -> Result i32 { + self.ppid + } + /// Name of command pub fn name(&self) -> String { self.command() diff --git a/crates/nu-system/src/macos.rs b/crates/nu-system/src/macos.rs index 6227e4f90..63a840980 100644 --- a/crates/nu-system/src/macos.rs +++ b/crates/nu-system/src/macos.rs @@ -302,6 +302,11 @@ impl ProcessInfo { self.pid } + /// Parent PID of process + pub fn ppid(&self) -> i32 { + self.ppid + } + /// Name of command pub fn name(&self) -> String { if let Some(path) = &self.curr_path { diff --git a/crates/nu-system/src/windows.rs b/crates/nu-system/src/windows.rs index 9bd89784d..ebc85f91c 100644 --- a/crates/nu-system/src/windows.rs +++ b/crates/nu-system/src/windows.rs @@ -1006,6 +1006,11 @@ impl ProcessInfo { self.pid } + /// Parent PID of process + pub fn ppid(&self) -> i32 { + self.ppid + } + /// Name of command pub fn name(&self) -> String { self.command.clone()