lolcat icon indicating copy to clipboard operation
lolcat copied to clipboard

lolcat doesn't seem to play nice with '\b' (backspace) or "\33[2K\r" (clear console line)

Open n-ham opened this issue 4 years ago • 3 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..

n-ham avatar Apr 14 '20 21:04 n-ham

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.

tbooth avatar May 13 '20 14:05 tbooth

@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'

m-o-e avatar Jun 06 '20 08:06 m-o-e

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

alexmyczko avatar Jul 29 '20 20:07 alexmyczko