Skip to content
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

Add 'kitty' and 'ansi' values as a fallback color support detection #58

Merged
merged 1 commit into from Jan 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions termenv_unix.go
Expand Up @@ -30,12 +30,20 @@ func colorProfile() Profile {
return ANSI256
}

switch term {
case "xterm-kitty":
return TrueColor
}

if strings.Contains(term, "256color") {
return ANSI256
}
if strings.Contains(term, "color") {
return ANSI
}
if strings.Contains(term, "ansi") {
return ANSI
}
Comment on lines +44 to +46
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be in the switch case above... as the string seems to be exactly ansi

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, had the same thought at first, but moved it down eventually: if it's foobar-ansi, it's probably still correct to assume it's supporting ANSI colors.


return Ascii
}
Expand Down