FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

New check for System.console tty on JDK 22+ by headius · Pull Request #8947 · jruby/jruby · GitHub

/ jruby Public

New check for System.console tty on JDK 22+ - #8947

Merged
headius merged 2 commits into
jruby:masterfrom
headius:jdk22_console_check
Aug 12, 2025
Merged

New check for System.console tty on JDK 22+#8947
headius merged 2 commits into
jruby:masterfrom
headius:jdk22_console_check

Conversation

headius commented Aug 7, 2025

Copy link
Copy Markdown
Member

This uses the new isTerminal method when running on JDK 22+ due to that version now always returning a non-null Console from System.console().

I may modify the handling of these color-configuring properties such that "true" means "use color if we are outputting to a terminal", defaulting to true.

Fixes #8934.

headius added this to the JRuby 10.0.3.0 milestone Aug 7, 2025

headius commented Aug 12, 2025

Copy link
Copy Markdown
Member Author

I added a very basic test that confirms a backtick subprocess does not default to using color. I'm not sure how to guarantee a test for a real TTY will trigger color... probably needs some pty magic I don't know.

We'll go with the simple negative test for now.

headius merged commit 7fbad38 into jruby:master Aug 12, 2025
72 checks passed
headius deleted the jdk22_console_check branch August 12, 2025 22:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JRuby under Java 22+ always thinks it's running under a TTY

1 participant


Back | FazBrowse Home | New Git URL