From 7ff1fb3278b756e73a71911d1ae9a702af1c221f Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Thu, 26 Mar 2026 11:10:58 +0800 Subject: [PATCH 1/2] fix: warn when $LESSCLOSE fails, not when it succeeds The Drop cleanup for Preprocessed inverted the exit-status check, so bat emitted a warning when LESSCLOSE exited successfully and stayed silent on failure. Align the condition with the intended behavior. --- src/lessopen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lessopen.rs b/src/lessopen.rs index 966bc2c096..81ae3cff2d 100644 --- a/src/lessopen.rs +++ b/src/lessopen.rs @@ -261,7 +261,7 @@ impl Drop for Preprocessed { } }; - if lessclose_output.status.success() { + if !lessclose_output.status.success() { bat_warning!("$LESSCLOSE exited with nonzero exit code",) }; } From 5c3b8040dbcbe6c39b84746ceab944fd97db859d Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Thu, 26 Mar 2026 11:11:19 +0800 Subject: [PATCH 2/2] fix: add changelog entry for LESSCLOSE warning fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 251e699d36..99831cf436 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Map `BUILD` case sensitively to Python (Starlark) for Bazel, see #3576 (@vorburger) ## Bugfixes +- Fix inverted `$LESSCLOSE` warning so bat warns on nonzero exit, not on success. See #3654 (@cuiweixie) - Fix i686 `.deb` package using incorrect architecture name (`i686` instead of `i386`), preventing installation on Debian. Closes #3611, see #3650 (@Sim-hu) - Fix inconsistent `.deb` MUSL package names (aarch64-musl used `arm64` instead of `musl-linux-arm64`, and `musleabihf` target missed `bat-musl` prefix). Closes #3482, see #3642 (@mvanhorn) - Fix incorrect text width computation when using `--binary=as-text` with non-printable characters in caret notation, see #3640 and #3631 (@eyupcanakman)