Open damnms opened 4 months ago
Maybe you could single-step through the terminalFactory.createScreen() call? That will make some checks as to whether it is running as a terminal application or as a graphical application. Apparently this guessery fails: it ends up wrongly believing to run in a terminal.
My own guess is, that intellij ultimate "half-way mimicks" a terminal-like environment, just not a complete one (where stty would work).
Did you recently update your JDK? I have discovered that your test program works just fine for me when built and run inside IntelliJ with JDK-21. I get the same error message about /bin/stty
when I set the project JDK to version 22.
I have verified this on Linux and macOS with IntelliJ 2024.1.4.
Java 22 changed behaviour for System.console
used in createTerminal()
:
so that System.console
no longer returns null when the standard streams are redirected or connected to a virtual terminal.
The workaround for now is to set a system property before calling createTerminal()
:
System.setProperty("jdk.console", "java.base");
@mabe02 Consider replacing the System.console() != null
call with a test to see if the method Console.isTerminal()
is available, and using it instead of checking System.console()
if so.
Yes, we should do that. Will add tonight.
Pushed to 3.0, 3.1 and master. Should do a new release soon:ish, think there was some other bugfixes merged that are pending.
I have a lanterna app that works quiet well, but i want to change a lot (different windows etc., at the moment its only 1), so i thought i start "fresh" and create everything new. But i fail in the very beginning somehow... and dont know why. Running debian trixie with regular java installed in intellij ultimate.
My code is this:
But it fails with:
This is wierd because it runs in the console. Anyone an idea why is that?