anstrip is a minimal library to strip ANSI sequences from strings.
It provides:
PATTERN
, the regex pattern used by the functions of anstripstrip
, a function to remove all the escape sequences from a stringauto_strip
, a function that is similar tostrip
, except that it only removes if the output is a TTYprint
, a function that is similar to the built-inprint
but with sequence auto-strippingprinted_length
, a function that returns the length of the string as seen on the screen