Class MessageUtils
java.lang.Object
org.apache.maven.jline.MessageUtils
Colorized message support. Maven only needs ANSI colors in its log output, so there is no terminal library here:
styles are emitted as plain SGR escape sequences, and only when color is enabled.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageBuilderbuilder()static intReturns the terminal width in columns, or-1if unknown.static booleanstatic booleanisTty()ReturnstrueifsystemInstall()detected an ANSI capable terminal on standard output.static voidsetColorEnabled(boolean enabled) static StringstripAnsiCodes(String msg) Remove any ANSI code from a message (colors or other escape sequences).static voidDetects whether standard output is an ANSI capable terminal and enables color accordingly.
-
Constructor Details
-
MessageUtils
public MessageUtils()
-
-
Method Details
-
systemInstall
public static void systemInstall()Detects whether standard output is an ANSI capable terminal and enables color accordingly. Only the CLI calls this; embedded use never does, so "auto" color stays off there. -
isTty
public static boolean isTty()ReturnstrueifsystemInstall()detected an ANSI capable terminal on standard output. -
setColorEnabled
public static void setColorEnabled(boolean enabled) -
isColorEnabled
public static boolean isColorEnabled() -
getTerminalWidth
public static int getTerminalWidth()Returns the terminal width in columns, or-1if unknown. Taken from theCOLUMNSenvironment variable if set, otherwise (on a detected non-Windows terminal) fromstty size. Computed once. -
builder
-
stripAnsiCodes
-