Skip to content

Commit

Permalink
fix: color profile is the maximum of env, terminfo, and tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Feb 18, 2025
1 parent 20e9098 commit 3e49392
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions env.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func Detect(output io.Writer, env []string) Profile {
tip := Terminfo(term)
tmuxp := tmux(environ)

// Color profile is the minimum of env, terminfo, and tmux.
return min(envp, min(tip, tmuxp))
// Color profile is the maximum of env, terminfo, and tmux.
return max(envp, max(tip, tmuxp))
}

return envp
Expand Down Expand Up @@ -279,8 +279,8 @@ func (e environ) get(key string) string {
return v
}

func min[T ~byte | ~int](a, b T) T {
if a < b {
func max[T ~byte | ~int](a, b T) T {
if a > b {
return a
}
return b
Expand Down

0 comments on commit 3e49392

Please sign in to comment.