From 43a3f4a5db1c61f1107cc0f1a6b6bf45b7dc6c11 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 12 Mar 2018 20:07:19 +0100 Subject: [PATCH 1/2] 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 { From c11ec3bf054a6b29ed094b9d9106ea7be4d6c08d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 12 Mar 2018 20:09:09 +0100 Subject: [PATCH 2/2] Add changelog entry for editor command stdin and stderr inherit --- doc/src/09020-changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/09020-changelog.md b/doc/src/09020-changelog.md index 42577032..e8eb0514 100644 --- a/doc/src/09020-changelog.md +++ b/doc/src/09020-changelog.md @@ -73,6 +73,8 @@ This section contains the changelog from the last release to the next release. * `imag-diary create --timed` did not work as expected * `libimagstore` got another fix with the file parsing, as the `std::str::Lines` iterator takes empty lines as no lines. + * `libimagentryedit` fixed to inherit stdin and stderr to child process for + editor command. ## 0.6.3