From 53c8185af386de682eccd9b7729a0b2327ed6421 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Mon, 23 Mar 2020 08:28:02 +1300 Subject: [PATCH] Fixes the crash for `ps --full` in Windows (#1514) * Fixes the crash for `ps --full` in Windows * Update ps.rs --- crates/nu_plugin_ps/src/ps.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/nu_plugin_ps/src/ps.rs b/crates/nu_plugin_ps/src/ps.rs index 52d8369b57..04c060dc39 100644 --- a/crates/nu_plugin_ps/src/ps.rs +++ b/crates/nu_plugin_ps/src/ps.rs @@ -66,11 +66,14 @@ pub async fn ps(tag: Tag, full: bool) -> Vec { 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());