oyvindberg/tui-scala

IO error: Os { code: 6, kind: Uncategorized, message: "Device not configured" }

Closed this issue · 0 comments

I've encountered this when trying to use the library:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.myapp.App.main(App.scala)
Caused by: java.lang.RuntimeException: IO error: Os { code: 6, kind: Uncategorized, message: "Device not configured" }
        at tui.crossterm.CrosstermJni.enableRawMode(Native Method)
        at tui.withTerminal$.apply(withTerminal.scala:9)
        at com.myapp.App$.<clinit>(App.scala:43)
        ... 1 more

It turned out it was because I used Gradle to run my app using this library. And I guess Gradle does something with the terminal.

Reporting here, to help others running into the same problem.
My workaround is to let Gradle build the app and then you can run the code without Gradle without issues, e.g.:

./gradlew installDist && app/build/install/app/bin/app