Description
JLine as the default Console provider was integrated into JDK 22-ea+8. The notes says:
JDK 22 Early-Access Release Notes
This is a draft of the release notes that will accompany JDK 22. The contents are subject to change until release.Build 8
JLine As The Default Console Provider (JDK-8308591)
core-libs/java.io
System.console() has changed in this release to return a Console with enhanced editing features that improve the experience of programs that use the Console API. In addition, System.console() now returns a Console object when the standard streams are redirected or connected to a virtual terminal. In prior releases, System.console() returned null for these cases. This change may impact code that uses the return from System.console() to test if the VM is connected to a terminal. If needed, running with-Djdk.console=java.base
will restore older behavior where the console is only returned when it is connected to a terminal.A new method Console.isTerminal() has been added to test if console is connected to a terminal.
This change makes the console-using standalone test fail on and only on JDK 22-ea: https://github.com/junit-team/junit5/actions/runs/5776317412/job/15655302994 - applying -Djdk.console=java.base
as mentioned above, makes the test(s) green again.