I notice that you're inserting \e[m before line endings. Apparently neither ta_length() nor ta_pad() can deal with this sequence (i.e. treat it as non-printing). I changed the two places in your code where you insert that sequence to insert \e[0m instead, and it passed my limited testing.
I don't know if that's the right fix, though. :-)
|Replies are listed 'Best First'.|
Re^3: Text::ANSI::Util for wrapping "colorful" text
by tybalt89 (Monsignor) on Aug 08, 2022 at 00:08 UTC