mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 00:38:23 +01:00
Fixes the crash for ps --full
in Windows (#1514)
* Fixes the crash for `ps --full` in Windows * Update ps.rs
This commit is contained in:
parent
36b5d063c1
commit
53c8185af3
@ -66,11 +66,14 @@ pub async fn ps(tag: Tag, full: bool) -> Vec<Value> {
|
||||
dict.insert_untagged("exe", UntaggedValue::string(exe.to_string_lossy()))
|
||||
}
|
||||
|
||||
if let Ok(command) = process.command().await {
|
||||
dict.insert_untagged(
|
||||
"command",
|
||||
UntaggedValue::string(command.to_os_string().to_string_lossy()),
|
||||
);
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
if let Ok(command) = process.command().await {
|
||||
dict.insert_untagged(
|
||||
"command",
|
||||
UntaggedValue::string(command.to_os_string().to_string_lossy()),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
output.push(dict.into_value());
|
||||
|
Loading…
Reference in New Issue
Block a user