ajalt / mordant

Multiplatform text styling for Kotlin command-line applications
https://ajalt.github.io/mordant/
Apache License 2.0
982 stars 34 forks source link

Request terminal features to be included in Java standard library #235

Closed mikaelstaldal closed 1 week ago

mikaelstaldal commented 1 week ago

It's unfortunate that Mordant requires native library on JVM, but currently unavoidable.

Maybe it would be good to request these features (check for interactivity, query terminal size, enter raw mode, anything else needed?) to be added to Java standard library.

Should be fairly easy to implement there given that some of this is already provided by java.io.Console. I would guess that [Console.readPassword()](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Console.html#readPassword()) needs to enter raw mode, and that [System.console()](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/System.html#console()) checks for interactivity.

ajalt commented 1 week ago

You're welcome to make requests to the Java committee, but that's out of scope for this library, so I'll close this issue.