mirror of
https://github.com/nushell/nushell.git
synced 2025-02-03 12:09:38 +01:00
Fix 'ps -l' output when a process doesn't have a parent process. (#3015)
Before, ps would not insert a value if the process didn't have a parent. Now, ps will insert an empty cell. This caused broken tables as some rows didn't have all the columns.
This commit is contained in:
parent
85329f9a81
commit
d66baaceb9
@ -45,6 +45,8 @@ pub async fn ps(tag: Tag, long: bool) -> Result<Vec<Value>, ShellError> {
|
||||
if long {
|
||||
if let Some(parent) = result.parent() {
|
||||
dict.insert_untagged("parent", UntaggedValue::int(parent));
|
||||
} else {
|
||||
dict.insert_untagged("parent", UntaggedValue::nothing());
|
||||
}
|
||||
dict.insert_untagged("exe", UntaggedValue::filepath(result.exe()));
|
||||
dict.insert_untagged("command", UntaggedValue::string(result.cmd().join(" ")));
|
||||
|
Loading…
Reference in New Issue
Block a user