]> glassweightruler.freedombox.rocks Git - xdg-ninja.git/blobdiff - xdg-ninja.sh
Fix broken output when using pager with glow
[xdg-ninja.git] / xdg-ninja.sh
index 2005e21234781db97bdcdf0c2267bc07a3baee3d..9d0151705c055291b5b43dc72968f84c3e5c49f7 100755 (executable)
@@ -9,6 +9,9 @@ auto_set_decoder() {
     DECODER="cat"
     if has_command glow; then
         DECODER="glow -"
+    elif has_command batcat; then
+        DECODER="batcat -pp --decorations=always --color=always --language markdown"
+        printf "Markdown rendering will be done by bat. (Glow is recommended)\n"
     elif has_command bat; then
         DECODER="bat -pp --decorations=always --color=always --language markdown"
         printf "Markdown rendering will be done by bat. (Glow is recommended)\n"
@@ -160,7 +163,7 @@ log() {
         ;;
 
     HELP)
-        decode_string "$HELP" | $DECODER
+        decode_string "$HELP" | PAGER="cat" $DECODER
         ;;
 
     esac