Merge pull request #1342 from matthiasbeyer/libimagentryedit/fix-editor-stdinerr-inherit

libimagentryedit: fix editor stdinerr inherit
This commit is contained in:
Matthias Beyer 2018-03-12 21:14:01 +01:00 committed by GitHub
commit fb9866bd46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -75,6 +75,8 @@ This section contains the changelog from the last release to the next release.
* `imag-diary create --timed` did not work as expected * `imag-diary create --timed` did not work as expected
* `libimagstore` got another fix with the file parsing, as the * `libimagstore` got another fix with the file parsing, as the
`std::str::Lines` iterator takes empty lines as no lines. `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 ## 0.6.3

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 {