batman: Remove dependency on col program

This follows proposed solution (C) in
https://github.com/sharkdp/bat/issues/2568
This commit is contained in:
Ethan P. 2024-02-12 00:58:56 -08:00
parent 3f259f1a07
commit 8460b39956
No known key found for this signature in database
GPG Key ID: 1BA2A0CC7C22B854

View File

@ -48,7 +48,8 @@ fi
if [[ "${BATMAN_IS_BEING_MANPAGER:-}" = "yes" ]]; then
print_manpage() {
col -bx | "$EXECUTABLE_BAT" --language=man "${BAT_ARGS[@]}"
sed -u -e 's/\x1B\[[0-9;]*m//g; s/.\x08//g' \
| "$EXECUTABLE_BAT" --language=man "${BAT_ARGS[@]}"
exit $?
}