binmode STDIN, ":raw:eol(LF)"; while () { s/\033[^m]*m//g; print $_;