Class TerminalColors
java.lang.Object
org.ek9lang.compiler.common.TerminalColors
Terminal color and symbol support with automatic capability detection.
Provides ANSI escape codes for colors and Unicode symbols for enhanced error display.
Automatically detects terminal capabilities and falls back gracefully:
- Full: Colors + Emoji + Box-drawing (modern terminals)
- Unicode: Colors + Box-drawing, no emoji (some terminals)
- Basic: Colors only, ASCII symbols (older terminals)
- Plain: No colors, ASCII only (dumb terminals, redirected output)
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringarrow()static Stringstatic StringBottom-left corner for heavy box drawing.static StringFormat error carets (^^^^^) under the error location.static Stringstatic Stringstatic Stringcorner()static Stringstatic Stringstatic StringerrorCaret(String text) Bright red for error carets (^^^^^) - more vivid than regular red.static StringerrorHeader(String errorCode, String message) Format an error header like: ❌ error[E50001]: messagestatic Stringstatic Stringstatic Stringstatic Stringstatic StringFormat a hint line like: ├─ 💡 Did you mean: 'count'?static Stringstatic Stringstatic Stringstatic Stringstatic booleanstatic booleanstatic booleanstatic StringFormat a link line like: └─ 🔗 See: https://...static Stringstatic StringFormat a location like: ──▶ file.ek9:15:12static Stringpipe()static StringpipeLine()Format the pipe-only line for visual separation.static StringsourceLine(int lineNumber, String source) Format a source line with line number.static Stringtee()static StringHeavy horizontal line for box drawing.static StringThe thick vertical bar for blockquote-style boxes.static StringTop-left corner for heavy box drawing.static StringverboseBlock(String text, String indent) Format a verbose explanation block with box corners.static Stringstatic StringwarningCaret(String text) Bright yellow for warning carets (^^^^^) - more vivid than regular yellow.static StringwarningHeader(String warningCode, String message) Format a warning header like: ⚠️ warning[W01234]: messagestatic Stringstatic String
-
Method Details
-
isColorsSupported
public static boolean isColorsSupported() -
isUnicodeSupported
public static boolean isUnicodeSupported() -
isEmojiSupported
public static boolean isEmojiSupported() -
errorSymbol
-
warningSymbol
-
infoSymbol
-
hintSymbol
-
linkSymbol
-
checkSymbol
-
fixSymbol
-
exampleSymbol
-
pipe
-
arrow
-
corner
-
tee
-
horizontalLine
-
error
-
errorCaret
-
warning
-
warningCaret
-
info
-
hint
-
code
-
dim
-
bold
-
white
-
errorHeader
-
warningHeader
-
location
-
sourceLine
-
carets
-
hintLine
-
linkLine
-
pipeLine
Format the pipe-only line for visual separation. -
thickPipe
The thick vertical bar for blockquote-style boxes. -
topCorner
Top-left corner for heavy box drawing. -
bottomCorner
Bottom-left corner for heavy box drawing. -
thickHorizontalLine
Heavy horizontal line for box drawing. -
verboseBlock
Format a verbose explanation block with box corners. Uses heavy box-drawing characters to encapsulate the explanation.- Parameters:
text- The multi-line verbose explanation textindent- The base indentation before the border- Returns:
- The formatted block with box borders
-