From 43a3f4a5db1c61f1107cc0f1a6b6bf45b7dc6c11 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 12 Mar 2018 20:07:19 +0100 Subject: [PATCH] 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. --- lib/core/libimagrt/src/runtime.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs index 8f18f75a..8bc1cf70 100644 --- a/lib/core/libimagrt/src/runtime.rs +++ b/lib/core/libimagrt/src/runtime.rs @@ -458,7 +458,12 @@ impl<'a> Runtime<'a> { .value_of("editor") .map(String::from) .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 {