Fix editor command

do inherit stdin and stderr from parent process, to not break terminal
editors when editing stuff.

vim printed "Input not from terminal" warning messages. This was fixed
by this commit.
This commit is contained in:
Matthias Beyer 2018-03-12 20:07:19 +01:00
parent 1bd91cfd0b
commit 43a3f4a5db

View file

@ -458,7 +458,12 @@ impl<'a> Runtime<'a> {
.value_of("editor") .value_of("editor")
.map(String::from) .map(String::from)
.or(env::var("EDITOR").ok()) .or(env::var("EDITOR").ok())
.map(Command::new) .map(|s| {
let mut c = Command::new(s);
c.stdin(::std::process::Stdio::inherit());
c.stderr(::std::process::Stdio::inherit());
c
})
} }
pub fn stdout(&self) -> OutputProxy { pub fn stdout(&self) -> OutputProxy {