Class AnsiMain

java.lang.Object
org.fusesource.jansi.AnsiMain

public class AnsiMain extends Object
Main class for the library, providing executable jar to diagnose Jansi setup.

If no system property is set and output is sent to a terminal (no redirect to a file):

  • any terminal on any Unix should get RESET_ANSI_AT_CLOSE mode,
  • on Windows, Git-bash or Cygwin terminals should get RESET_ANSI_AT_CLOSE mode also, since they support natively ANSI escape sequences like any Unix terminal,
  • on Windows, cmd.exe, PowerShell or Git-cmd terminals should get WINDOWS mode.
If stdout is redirected to a file (> out.txt), System.out should switch to STRIP_ANSI. Same for stderr redirection (2> err.txt) which should affect System.err mode.

The results will vary if you play with jansi.passthrough, jansi.strip or jansi.force system property, or if you redirect output to a file.

If you have a specific situation that is not covered, please report precise conditions to reproduce the issue and ideas on how to detect precisely the affected situation.

See Also:
  • Constructor Details

    • AnsiMain

      public AnsiMain()
  • Method Details

    • main

      public static void main(String... args) throws IOException
      Throws:
      IOException
    • getJansiVersion

      private static String getJansiVersion()
    • diagnoseTty

      private static void diagnoseTty(boolean stderr)
    • testAnsi

      private static void testAnsi(boolean stderr)
    • getPomPropertiesVersion

      private static String getPomPropertiesVersion(String path) throws IOException
      Throws:
      IOException
    • printJansiLogoDemo

      private static void printJansiLogoDemo() throws IOException
      Throws:
      IOException
    • writeFileContent

      private static void writeFileContent(File f) throws IOException
      Throws:
      IOException
    • closeQuietly

      private static void closeQuietly(Closeable c)