Environment Information
- JRuby version (
jruby -v):
jruby 10.0.0.0-SNAPSHOT (3.4.2) 2025-07-31 55a0013630 OpenJDK 64-Bit Server VM 24.0.1 on 24.0.1 +indy +jit [arm64-darwin]
- Operating system:
Darwin
Bug description
JRuby uses System.console() != null internally to determine whether it's printing to a TTY. On Java 22+, System.console() always returns an object, so System.console().isTerminal() has to be used instead. As it is now, this causes JRuby to print ANSI color codes to non-terminals, e.g. when using -Xir.print.