From 27c68692f1d20fe835ff4bdc7d70cb336bb2b6db Mon Sep 17 00:00:00 2001 From: Ethan P Date: Fri, 2 Apr 2021 16:32:02 -0700 Subject: [PATCH] batwatch: Show the watched command in bat's header --- src/batwatch.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/batwatch.sh b/src/batwatch.sh index f787fb6..a8572db 100755 --- a/src/batwatch.sh +++ b/src/batwatch.sh @@ -15,6 +15,7 @@ source "${LIB}/opt_hook_version.sh" source "${LIB}/opt_hook_width.sh" source "${LIB}/print.sh" source "${LIB}/pager.sh" +source "${LIB}/version.sh" # ----------------------------------------------------------------------------- # Init: # ----------------------------------------------------------------------------- @@ -275,6 +276,13 @@ if [[ "$OPT_MODE" = "file" ]]; then return $? } else + + # Set bat's header to show the command. + BAT_VERSION="$(bat_version)" + if version_compare "$BAT_VERSION" -ge "0.14"; then + BAT_ARGS+=(--file-name="${FILES[*]}") + fi + main() { while true; do clear