jline / jline3

JLine is a Java library for handling console input.
Other
1.49k stars 218 forks source link

Unable to use JLine from Gradle / Maven #77

Closed vitalyster closed 6 years ago

vitalyster commented 7 years ago

How should I set up Terminal and LineReader when running application from Gradle (./gradlew run)?

vitalyster commented 7 years ago

Under linux I got message: WARNING: Unable to create a system terminal, creating a dumb terminal, under Windows it returns silently

gnodet commented 7 years ago

I suppose gradle creates a new process. In order to run a terminal correctly, this new process needs to inherit the input / output streams of the gradle process itself (that's [doable using java 7](https://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html#inheritIO())).
You need to check the gradle doc if that's possible. I suppose maven has the same problem.

gnodet commented 7 years ago

The exec-maven-plugin uses commons-exec which is still java 1.5 afaik, so it clearly does not support the io inheritance which would be needed. This would require a new plugin.

gnodet commented 6 years ago

Closing this one as it seems to one in gradle or maven is willing to improve the support so that the real terminal can be used.

squarepegsys commented 6 years ago

For anyone else getting here trying to use jline with gradle run -- I found this work-around: https://github.com/tkruse/gradle-groovysh-plugin/blob/master/doc/InstallAppShellManually.md

And then run it with gradle -Porg.gradle.daemon=false --console=plain shell