Ps: add cwd column on linux and macos (#10347)

# Description
Close:  #7484

Just found that I want `cwd` column on linux/macos as well..
This commit is contained in:
WindSoilder
2023-09-14 21:10:15 +08:00
committed by GitHub
parent 026e18399e
commit 2c176a7f14
3 changed files with 28 additions and 1 deletions

View File

@ -143,6 +143,7 @@ fn run_ps(engine_state: &EngineState, call: &Call) -> Result<PipelineData, Shell
// record.push("tpg_id", Value::int(proc_stat.tpgid as i64, span));
record.push("priority", Value::int(proc_stat.priority, span));
record.push("process_threads", Value::int(proc_stat.num_threads, span));
record.push("cwd", Value::string(proc.cwd(), span));
}
#[cfg(windows)]
{
@ -184,6 +185,10 @@ fn run_ps(engine_state: &EngineState, call: &Call) -> Result<PipelineData, Shell
),
);
}
#[cfg(target_os = "macos")]
{
record.push("cwd", Value::string(proc.cwd(), span));
}
}
output.push(Value::record(record, span));