TTY testing 

my $opt = {
    use_ansi_formatting   => (-t STDOUT),
};