-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: add xterm and rio color profiles #22
Conversation
3a733d2
to
5efe5c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice
TERM=@raphamorim 👀 |
see charmbracelet/colorprofile#22 Signed-off-by: Carlos Alexandro Becker <[email protected]>
see charmbracelet/colorprofile#22 Signed-off-by: Carlos Alexandro Becker <[email protected]>
honestly liked it better checking whole terminal names instead of splitting by |
I think I agree, for readability and to decrease ambiguity. |
Some terminals like |
@aymanbagabas i would prob just add all of them statically 🤔 |
@caarlos0 This PR build on this one and adds support for Terminfo and queries Tmux #24 |
This adds `TERM=rio` as a TrueColor profile and `TERM=xterm` as an ANSI profile.
a1ef911
to
aa5a93a
Compare
We will keep adding more and more, like I just noticed that there's a |
This adds two new functions to detect the color profile based on the terminal's terminfo database and tmux configuration. The `Terminfo` function returns the color profile based on the terminal's terminfo database. This relies on the Tc and RGB capabilities to determine if the terminal supports TrueColor. The `Tmux` function returns the color profile based on `tmux info` output. Tmux supports overriding the terminal's terminfo database, so this function will return the color profile based on `tmux info` output which is taken from the tmux configurations. Now, `Detect` will return the minimum of the color profile based on the environment, terminfo, and tmux. This ensures that the color profile is the most accurate based on the terminal's capabilities. Environment variables take precedence over terminfo and tmux.
This adds
TERM=rio
as a TrueColor profile andTERM=xterm
as an ANSI profile.