-
Notifications
You must be signed in to change notification settings - Fork 34
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
Colour not being detected #1
Comments
System.console() is returning null, but we know intellij can do colour as log4j etc will happily output in colour in intellij. |
Yeah, Java's terminal detection is shamefully bad. If you're writing a program where you know you'll always be used interactively, you can force color output: For the IntelliJ case specifically, It looks like There's also the possibility of using JNI to call the native What do you think about any of those options? |
Either of the first two. Maybe update docs for the ability to override. |
Ok, I just released version 1.2.1 which should improve the detection in the IntelliJ console. It turned out that neither Let me know if that works, or if you have any ideas on better approaches. You can always still force a color option if you find that detection isn't reliable enough. |
Detects it as None for me I'm afraid. Maybe it works on a Mac but not Linux? |
These are the input args to the management bean on my machine.
|
It might just be me. I'll come back to you shortly.
…On Sat, 15 Jun 2019, 18:25 AJ Alt, ***@***.***> wrote:
Reopened #1 <#1>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=AAFVSGXC4SBFQF3L7QRFHVLP2V26LA5CNFSM4G45G3GKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOR752UPY#event-2415635007>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFVSGR3MBUIR27VJDCCNPTP2V26LANCNFSM4G45G3GA>
.
|
I was running the gradle task through intellij, so I don't know if that
counts as "intellij" or not. Probably not.
But it detects it as None regardless, and same for when running through
gradle at the command line.
…On Sat, 15 Jun 2019 at 18:59, Stephen Samuel (Sam) ***@***.***> wrote:
It might just be me. I'll come back to you shortly.
On Sat, 15 Jun 2019, 18:25 AJ Alt, ***@***.***> wrote:
> Reopened #1 <#1>.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#1?email_source=notifications&email_token=AAFVSGXC4SBFQF3L7QRFHVLP2V26LA5CNFSM4G45G3GKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOR752UPY#event-2415635007>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAFVSGR3MBUIR27VJDCCNPTP2V26LANCNFSM4G45G3GA>
> .
>
|
Yes, an IntelliJ gradle task is the same as running gradle from the command line. I'm pretty sure gradle wraps stdout, so I welcome other suggestions on how to improve the behavior. |
I can do that as you suggest, and that should work fine.
…On Sun, 16 Jun 2019 at 12:38, AJ Alt ***@***.***> wrote:
Yes, an IntelliJ gradle task is the same as running gradle from the
command line. I'm pretty sure gradle wraps stdout, so isatty returns
false. Even if we detect that we're running in gradle, the user can still
redirect gradle's stdout, so always using colors inside gradle would be
incorrect. Maybe you can configure your gradle task to set the envvar
COLORTERM=truecolor, which will cause mordant to always use color?
I welcome other suggestions on how to improve the behavior.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1?email_source=notifications&email_token=AAFVSGWVJYB2PUHXNP4MBUTP2Z3ABA5CNFSM4G45G3GKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXZRVDQ#issuecomment-502471310>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFVSGSCEC5AFR6UX2FBUZDP2Z3ABANCNFSM4G45G3GA>
.
|
Ok. I'll leave this issue open for now in case someone knows of a better solution. |
IntelliJ's run window has always been shoddy. I'm disappointed that only PyCharm has an actual terminal emulator. I mean come on, you gave PYTHON a terminal, but not Java, or C++?! |
Looking for Idea compatibility, I found this issue.. @sksamuel I tried to clone this project itself and run the am I missing something? IntelliJ IDEA 2020.1 EAP (Ultimate Edition) |
on the windows command line there's also no color and if it is forced then there's just garbage characters. edit: it appears that colors in the windows console must be manually enabled using regedit. please refer to this issue on how to do that edit 2: while this registry editing method linked above does allow colors, mordant will still think the terminal is incapable of colors and thus won't use colors if auto detection is used |
Using intellij, just a simple function to output some colour.
JDK11, Intellij 2018.3, Mordant 1.2.0
The text was updated successfully, but these errors were encountered: