cowsay is confused by input with ansi colour codes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cowsay (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The maxlength function to construct the bubble calculates string length including escape sequences so although the colours are printed in the output the surrounding bubble is malformed, e.g.:
$ figlet "Hello World!" | toilet -f term --metal | /usr/games/cowsay -n
This can be solved by removing the escape sequences during string length calculations by applying one of the attached diffs. I have not tested the older versions one with an older perl to be certain it is correct.
(I am aware I could switch toilet / cowsay in the pipe but with this order I get a coloured message with a black and white cow.)
$ lsb_relase -rd
Description: Ubuntu 14.04.2 LTS
Release: 14.04
$ apt-cache policy cowsay
cowsay:
Installed: 3.03+dfsg1-6
Candidate: 3.03+dfsg1-6
Version table:
*** 3.03+dfsg1-6 0
990 http://
100 /var/lib/
Changed in cowsay (Ubuntu): | |
status: | New → Confirmed |
Support for older versions of perl