-
Notifications
You must be signed in to change notification settings - Fork 37
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
Accept more forced color values #156
Conversation
@ajalt, |
I'm -1 on this. FORCE_COLOR and COLORTERM are standard-ish variablers used by other libraries. I don't want really want mordant to behave differently than everyone else. |
I don't see a problem with being lenient WRT the accepted values. I mean, we're not setting these variables and expecting other applications to adhere to that. Also, "24bits" (plural) is already accepted for Finally, this mordant/mordant/src/commonMain/kotlin/com/github/ajalt/mordant/terminal/TerminalDetection.kt Lines 137 to 139 in 13fce2b
says "We try to support them all", so I really believe this should be fine. |
To give you more background, this is to make this work-around function better: Apparently, |
20cbdd4
to
a32a5ed
Compare
a32a5ed
to
fb19e3f
Compare
@ajalt, mind having another look? I've split the commit into two to make the intent more clear. |
So i looked at the workaround you posted and I'm a little confused: why are you copying |
Extend the color variables to leniently accept more color values. So besides only `FORCE_COLOR=256color`, also accept e.g. `FORCE_COLOR=256colors` to force 256 colors. Similarly, besides `FORCE_COLOR=truecolor`, accept e.g. `FORCE_COLOR=24bits` to force true colors.
fb19e3f
to
2bce7d9
Compare
Not sure what you mean by "copying". Anyway, I've split into yet one more commit and hopefully clarified in the respective commits messages. |
Thanks for the additional clarification, but I'm still not in favor of this change. In the next major release, I plan to move in the opposite direction: I want to accept only the standard values of |
I've split my commits so that it could still make sense to just pick the first commit of this PR. Feel free to do that.
Would you have a pointer to what the definite / standardized values of these are? To me, it do es not seem to clearly specified anywhere, which was my motivation to be lenient in the accepted values. |
While at it, extract color values for TERM / COLORTERM to variables.