some custom handling of ANSI escape codes