From 6e02ef6486b6660b69136e19c7086e8b2b3eb7ee Mon Sep 17 00:00:00 2001 From: rabite Date: Sun, 3 Mar 2019 00:57:06 +0100 Subject: merge child process stderr with stdout --- src/proclist.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/proclist.rs b/src/proclist.rs index 9a747c2..79036b9 100644 --- a/src/proclist.rs +++ b/src/proclist.rs @@ -1,6 +1,7 @@ use std::sync::{Arc, Mutex}; use std::sync::mpsc::Sender; use std::process::Child; +use std::os::unix::process::CommandExt; use std::io::{BufRead, BufReader}; use termion::event::Key; @@ -76,8 +77,7 @@ impl ListView> { .arg(cmd) .stdin(std::process::Stdio::null()) .stdout(std::process::Stdio::piped()) - //.stderr(unsafe { Stdio::from_raw_fd(2) }) - .stderr(std::process::Stdio::piped()) + .before_exec(|| unsafe { libc::dup2(1, 2); Ok(()) }) .spawn()?; let mut proc = Process { cmd: cmd.to_string(), -- cgit v1.2.3