A JRuby user reported that we are outputting ANSI escape sequences even when piping output to a non-TTY process like "less" or "more". The logic in JRuby determines TTYness by checking the value of java.lang.System.console(), which should be null when stdin and stdout are not both attached to a TTY. However when running in the Windows Subsystem for Linux (WSL), it appears that this is not the case; java.lang.System.console() returns a non-null ProxyingConsole instance even when output is being piped to a non-TTY process.
This most likely affects any other projects that uses java.lang.System.console() to detect a TTY, such as to provide color or bold text output.
This most likely affects any other projects that uses java.lang.System.console() to detect a TTY, such as to provide color or bold text output.
- relates to
-
JDK-8351435 Change the default Console implementation back to the built-in one in `java.base` module
-
- Resolved
-