summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-03-03 00:57:06 +0100
committerrabite <rabite@posteo.de>2019-03-03 00:57:06 +0100
commit6e02ef6486b6660b69136e19c7086e8b2b3eb7ee (patch)
tree64a559c28d5372fdea844e366bd43904794f423b
parent86250206c32dc55ca5be44b528028323d2227e9c (diff)
merge child process stderr with stdout
-rw-r--r--src/proclist.rs4
1 files changed, 2 insertions, 2 deletions
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<Vec<Process>> {
.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(),