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
Install Eclipse Temurin 22.0.1+8 in Windows 10. Run the SBT console for any project from the cmd.exe terminal. Then try to work in the console: enter different commands, try to insert into the console text from the clipboard.
problem
The SBT console "swallows" (skips) certain key strokes: symbols do not appear in the console. Also does not work properly copy and paste.
cause and workaround
The problem seems to be that JDK 22 has changed the behavior of System.console():
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.
Setting the -Djdk.console=java.base option in .jvmopts solves the problem: SBT starts working normally.
The text was updated successfully, but these errors were encountered:
steps
Install Eclipse Temurin 22.0.1+8 in Windows 10. Run the SBT console for any project from the
cmd.exe
terminal. Then try to work in the console: enter different commands, try to insert into the console text from the clipboard.problem
The SBT console "swallows" (skips) certain key strokes: symbols do not appear in the console. Also does not work properly copy and paste.
cause and workaround
The problem seems to be that JDK 22 has changed the behavior of
System.console()
:Setting the
-Djdk.console=java.base
option in.jvmopts
solves the problem: SBT starts working normally.The text was updated successfully, but these errors were encountered: