lolcat doesn't seem to play nice with '\b' (backspace) or "\33[2K\r" (clear console line)
n-ham opened this issue · comments
The '\b' character is often used for backspace and "\33[2K\r" is used to clear the console line on unix machines. Neither of which lolcat seems to play nicely with. It would be awesome if you were able to update lolcat so it does..
Yeah I was hoping to make all my manpages look nice with something like:
$export MANPAGER='bash -c "lolcat -f \"\$@\" | less -R" PAGER'
But I just start seeing all the ^H control codes. Meh.
@n-ham @tbooth
lolcat tries to deal with control sequences to a degree
but it's tricky and it doesn't always succeed.
This may be improved in the future (PRs always welcome 😬).
In most cases you can help it a little by stripping the
problematic sequences before feeding the input to lolcat.
For man-pages you can use this:
export MANPAGER='bash -c "col -bx | lolcat -f \"\$@\" | less -R" PAGER'
HERE BE DRAGONS. another trick is bash | lolcat
(NO WARRANTIES) (OR $SHELL
)
that works ok good with mc
, ncdu
, but not so much with modplug123
, nor ocp