You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: fix Jansi AnsiConsole broken color detection in uber jars (#1305)
The AnsiType detection logic was incorrectly inverted, causing colors to be
disabled in uber jar scenarios. When getSystemStream() returns null (indicating
a native terminal), the type should be AnsiType.Native, not AnsiType.Redirected.
This fix corrects the ternary operator logic:
- When getSystemStream() == null: AnsiType.Redirected (output is redirected)
- When getSystemStream() != null: AnsiType.Native (native terminal with color support)
The original Jansi library worked in uber jars because it had different terminal
detection logic. JLine's Jansi compatibility layer was incorrectly marking
native terminals as redirected, which disabled ANSI color processing.
This simple but critical fix ensures that:
- Colors work correctly in uber jars on Windows and other platforms
- Native terminal detection works as expected
- ANSI escape sequences are properly processed instead of being stripped
- Maintains full backward compatibility with existing applications
Fixes#1292
0 commit comments