From 9438a74e6d01b7b2400caa6353d7e0048d3a47a9 Mon Sep 17 00:00:00 2001 From: yuwk <1729065730@qq.com> Date: Fri, 16 Oct 2026 02:04:02 +0800 Subject: [PATCH] Report BAT_CONFIG_DIR in bat --diagnostic BAT_CONFIG_DIR overrides the config directory (src/bin/bat/directories.rs) and is documented in the README, but it was missing from the environment list that bat --diagnostic prints, so a bug report never showed where bat was actually reading its config from. Extend diagnostic_sanity_check to cover it. --- src/bin/bat/main.rs | 1 + tests/integration_tests.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index 359219be..9019e9d6 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -333,6 +333,7 @@ fn invoke_bugreport(app: &App, cache_dir: &Path) -> Result<()> { .info(CommandLine::default()) .info(EnvironmentVariables::list(&[ "BAT_CACHE_PATH", + "BAT_CONFIG_DIR", "BAT_CONFIG_PATH", "BAT_OPTS", "BAT_PAGER", diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 9463be37..f4c21815 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1755,6 +1755,7 @@ fn diagnostic_sanity_check() { .success() .stdout(predicate::str::contains("BAT_PAGER=")) .stdout(predicate::str::contains("BAT_WIDTH=")) + .stdout(predicate::str::contains("BAT_CONFIG_DIR=")) .stderr(""); }