https://kotlinlang.org logo
Title
d

Danish Ansari

08/19/2021, 7:06 AM
Hi everyone, Is there anything available for Kotlin(or Java) similar to https://github.com/SBoudrias/Inquirer.js? I found https://github.com/kotlin-inquirer/kotlin-inquirer but when I run it on windows CLI(which is my project's primary target), the CMD goes brrrrrrr.... 😅 The inputs keep appearing again and again and doesn't wait for the user to give input
e

ephemient

08/19/2021, 7:12 AM
yeah, looks like it hard-codes ANSI escape codes
(I don't have Windows here so I don't know if that helps, but at least it's newer than the ancient conhost)
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#example-of-enabling-virtual-terminal-processing shows how to force-enable ANSI escape codes in Windows 10 Anniversary Update, which I'd expect to work in cmd.exe, but requires native code
d

Danish Ansari

08/19/2021, 7:17 AM
the thing is I'm using windows but the user can be on any OS
I simply want basic interactive components for CLI like Single/ Multiple choice list etc
e

ephemient

08/19/2021, 7:26 AM
well, ANSI escape codes should work on every other OS out there, it's just Windows that's "special"
d

Danish Ansari

08/19/2021, 7:28 AM
ok thanks
e

ephemient

08/19/2021, 7:29 AM
you can maybe try to reuse something like https://github.com/gradle/native-platform#terminal-and-console which already has custom native bindings for Windows and other platforms
d

Danish Ansari

08/19/2021, 7:41 AM
thanks
y

Yaniv Grama

02/03/2022, 11:06 PM
Hey @Danish Ansari, I’m the author of kotlin-inquirer please check out the latest version I think it should resolve your issue LMK if not 🙂 and thank you for trying it out 👍