···2626 print_endline (Format.flush_str_formatter ())
2727 ;;
28282929+ (** Prints the attribute in a human readable format.
3030+ Also replaces the escape character with \e.
3131+ This means the output can be copy pasted into a terminal to test.
3232+ like: `echo -e "attr: \e[0;31mTEXT\e[0m"` *)
2933 let print_attr img =
3034 print_endline "attr:";
3135 img |> Notty.Render.pp_attr @@ Format.str_formatter;
3232- print_endline (Format.flush_str_formatter ())
3636+ print_endline (Format.flush_str_formatter ()|>Str.global_replace (Str.regexp "\027") "\\e")
3337 ;;
34383539 (** Like fold left except we run the first element through init to get the state*)
···193197194198 [%expect
195199 {|
196196- attr:
197197- [0m<[0;32mATTR[0m[K[0m>[0m |}]
200200+ attr:
201201+ \e[0m<\e[0;32mATTR\e[0m\e[K\e[0m>\e[0m
202202+ |}]
198203 ;;
199204200205 let parse_ansi_escape_codes (input : string) =