Skip to content

Instantly share code, notes, and snippets.

@scottchiefbaker
scottchiefbaker / term_test.pl
Created October 18, 2013 18:35
Test terminal color detection.
my $depth = terminal_color_depth();
print "My terminal has " . $depth . " colors\n";
sub terminal_color_depth {
# If we're not attached to an STDOUT don't go any further
if (!-t STDOUT) {
return 8;
}