You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In JDK 22, System.console() has been changed 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. Prior to JDK 22, System.console() instead returned null for these cases. This change may impact code that checks the return from System.console() to test if the JVM is connected to a terminal. If required, the -Djdk.console=java.base flag will restore the old behavior where the console is only returned when it is connected to a terminal. Starting JDK 22, one could also use the new Console.isTerminal() method to test if the console is connected to a terminal.
//if console != null its a native terminal, not redirects etc
if(System.console() != null)
returnnewWinSysTerminal(name, nativeSignals);
else {
returnnewWinExternalTerminal(name, type, (in == null) ? System.in : in,
(out == null) ? System.out : out);
}
should be changed to:
if (System.console() != null && System.console().isTerminal())
However, isTerminal() is a new method in JDK22. Alternatively, access the private static method Console::istty()isTerminal via reflection.
Note: Jansi crashes the JVM on initializing org.fusesource.jansi.AnsiConsole when System.console().isTerminal() is false. Related: quarkusio/quarkus#39575
The text was updated successfully, but these errors were encountered:
Since JDK22:
So, this check:
aesh-readline/readline/src/main/java/org/aesh/readline/terminal/TerminalBuilder.java
Lines 146 to 152 in d171b39
should be changed to:
However,
isTerminal()
is a new method in JDK22. Alternatively, accessthe private static methodConsole::istty()
isTerminal
via reflection.Note: Jansi crashes the JVM on initializing
org.fusesource.jansi.AnsiConsole
whenSystem.console().isTerminal()
is false. Related: quarkusio/quarkus#39575The text was updated successfully, but these errors were encountered: