Fix ANSI terminal detection.