diff --git a/CHANGELOG.md b/CHANGELOG.md index cfc4c4dd..1d2e41a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Features ## Bugfixes - +- issue 2561, send all [bat error]s to stderr in default_error_handler match default. - Fix `NO_COLOR` support, see #2767 (@acuteenvy) ## Other diff --git a/src/error.rs b/src/error.rs index 007737b0..24c1409f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -67,7 +67,15 @@ pub fn default_error_handler(error: &Error, output: &mut dyn Write) { .ok(); } _ => { - writeln!(output, "{}: {}", Red.paint("[bat error]"), error).ok(); + // default - always write [bat error] to stderr + let stderr = std::io::stderr(); + writeln!( + &mut stderr.lock(), + "{}: {}", + Red.paint("[bat error]"), + error + ) + .ok(); } }; }