Class AnsiConsole

    • Method Detail

      • getTerminalWidth

        public static int getTerminalWidth()
        Try to find the width of the console for this process. Both output and error streams will be checked to determine the width. A value of 0 is returned if the width can not be determined.
        Since:
        2.2
      • out

        public static AnsiPrintStream out()
        If the standard out natively supports ANSI escape codes, then this just returns System.out, otherwise it will provide an ANSI aware PrintStream which strips out the ANSI escape sequences or which implement the escape sequences.
        Returns:
        a PrintStream which is ANSI aware.
      • sysOut

        public static PrintStream sysOut()
        Access to the original System.out stream before ansi streams were installed.
        Returns:
        the originial System.out print stream
      • err

        public static AnsiPrintStream err()
        If the standard out natively supports ANSI escape codes, then this just returns System.err, otherwise it will provide an ANSI aware PrintStream which strips out the ANSI escape sequences or which implement the escape sequences.
        Returns:
        a PrintStream which is ANSI aware.
      • sysErr

        public static PrintStream sysErr()
        Access to the original System.err stream before ansi streams were installed.
        Returns:
        the originial System.err print stream
      • systemInstall

        public static void systemInstall()
        Install AnsiConsole.out() to System.out and AnsiConsole.err() to System.err.
        See Also:
        systemUninstall()
      • isInstalled

        public static boolean isInstalled()
        check if the streams have been installed or not