-
Notifications
You must be signed in to change notification settings - Fork 90
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
Use terminfo instead of hardcoding a list of terminals #25
Comments
Please use this instead of hardcore logic 🙏 |
Also WSL has true color support. |
Here's how I did it https://github.com/Delta456/box-cli-maker/blob/dev/util.go, see |
ok, thanks |
I found this from https://www.github.com/chalk/supports-color/tree/master/index.js
|
Thanks you. I refer code please see https://github.com/gookit/color/blob/master/detect_env.go |
@inhere Amazing! Would appreciate if you could also add my repo as reference in the |
Also I believe you could had imported my module and used it instead of making one. |
hi @Delta456 Your module also has some problems, please see my detection code Lines 31 to 156 in 1459bf6
And my package as the base package, can not rely on your application package in reverse. :) |
Hey!
You should use terminfo instead of relying on the terminal name in TERM. This can provide you the number of colors supported. Otherwise, you are missing a lot of terminals supporting colors, like
rxvt
orscreen
. In Go, it seems https://github.com/xo/terminfo can do that. It also seems to handle some edge cases for terminals not using the correct TERM. It also handles the special case of true color which was not available through terminfo until recently and is able to fallback toCOLORTERM
(but it should be using Tc if available).The text was updated successfully, but these errors were encountered: