bat-extras
bat-extras copied to clipboard
batman hangs when using BAT_PAGER
If I export BAT_PAGER=less
then batman <page>
hangs on macOS 13 & 14.
I can see (via PS) it running many copies of bat --language=man...
until it hits a fork limit.
At the moment, I can reproduce at will.
EDIT: no, my workaround doesn't work with the conky manual, something is wrong with formatting. I ended up just setting $MANPAGER
to "$BAT_PAGER"
(so not using bat anymore).
Non-working solution
I tried finding a workaround by setting `$MANPAGER` but had some issues with it. Here's what I ended up with:export PAGER="bat -p"
export BAT_PAGER="less -RF --jump-target=.5" # change to your liking
__myman() {
man $@ | bat -l man -p
}
alias man="__myman"
For ZSH completion, put this after the autoload -U compinit
line in your zshrc:
compdef _man __myman
Meaning "use the man
completion for __myman
".
I can verify the same behavior here on both MacOS Sonoma and NixOS. Unsetting BAT_PAGER allows batman to work properly.
On a side note, setting MANPAGER to anything seems to be ignored.
That was quite the interesting one to debug. Thanks for finding this!
Fixed in commit 205e9c4.
Released in v2024.02.12.