From 0ff9cc679ebaa4a423cf304cbfe33d80556a99ff Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Sat, 12 Mar 2022 10:54:59 -0600 Subject: [PATCH] add `$nu.pid` (#4828) --- crates/nu-engine/src/eval.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/nu-engine/src/eval.rs b/crates/nu-engine/src/eval.rs index 4a33b6d3a..9f9ffe78c 100644 --- a/crates/nu-engine/src/eval.rs +++ b/crates/nu-engine/src/eval.rs @@ -1147,6 +1147,10 @@ pub fn eval_variable( }) } + let pid = std::process::id(); + output_cols.push("pid".into()); + output_vals.push(Value::int(pid as i64, span)); + Ok(Value::Record { cols: output_cols, vals: output_vals,