presto-cli/src/main/java/io/prestosql/cli/ConsolePrinter.java/ConsolePrinter/detectRealTerminal
class ConsolePrinter:    private static boolean detectRealTerminal()
    {
        try (Terminal terminal = terminal()) {
            return !Terminal.TYPE_DUMB.equals(terminal.getType()) &&
                    !Terminal.TYPE_DUMB_COLOR.equals(terminal.getType());
        }
        catch (IOException e) {
            return false;
        }
    }