-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntelliJ console is not detected from a code started via Gradle's JavaExec task #7
Comments
The actual environment variables from the Gradle session under IntelliJ (committing obvious ones):
The |
Checking If you know you're going to be running on an interactive terminal, you can force a given color level when creating your TermColors(TermColors.Level.TRUECOLOR) |
It looks like the TERM variable check can be made before the check of the
console to be available. It seems like (but please tell me if I'm wrong)
that coloring options are available for that case and the caret moves are
not.
…On Thu, Oct 22, 2020 at 10:22 PM AJ Alt ***@***.***> wrote:
Checking System.console() != null is all we have access to on the JVM. If
you know of a way to improve detection here outside of JNI, I'd love to
hear it. But unfortunately, I'm not sure there's anything we can do.
If you know you're going to be running on an interactive terminal, you can
force a given color level when creating your TermColors instance. For
example, to always output truecolor:
TermColors(TermColors.Level.TRUECOLOR)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB6TL6NHPUJA7HDTJMSAIDSMCH7VANCNFSM4S3TS5GQ>
.
|
I don't think that's reliable. Ignoring |
I agree. It would be nice allow manually call the terminal mode detection without the console mode check. That could be a solution to my case, so I could call the detection and ignore the console mode check. Would that make sense? |
Yes, that seems like a good idea. I'll look into implementing the option to force interactivity while still detecting other terminal info. |
I implemented this suggestion in 2.0.0-alpha2: If you create your terminal with |
I have a Java application with the library and start it from IntelliJ IDEA via a Gradle JavaExec task.
The console is not detected in that scenario.
The detector code actually fails on the line
The text was updated successfully, but these errors were encountered: