We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9bab505 commit 2ef5976Copy full SHA for 2ef5976
jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
@@ -72,10 +72,13 @@ public static OutputStream wrapOutputStream(final OutputStream stream) {
72
73
// We must be on some unix variant..
74
try {
75
+ // If the jansi.force property is set, then we force to output
76
+ // the ansi escapes for piping it into ansi color aware commands (e.g. less -r)
77
+ boolean forceColored = Boolean.getBoolean("jansi.force");
78
// If we can detect that stdout is not a tty.. then setup
79
// to strip the ANSI sequences..
80
int rc = isatty(STDOUT_FILENO);
- if( rc==0 ) {
81
+ if( !forceColored && rc==0 ) {
82
return new AnsiOutputStream(stream);
83
}
84
0 commit comments