merge child process stderr with stdout

This commit is contained in:
rabite 2019-03-03 00:57:06 +01:00
parent 86250206c3
commit 6e02ef6486
1 changed files with 2 additions and 2 deletions

View File

@ -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(),