diff --git a/termenv_unix.go b/termenv_unix.go index 35211da..0ec89f2 100644 --- a/termenv_unix.go +++ b/termenv_unix.go @@ -35,10 +35,13 @@ func colorProfile() Profile { case "24bit": fallthrough case "truecolor": - if term == "screen" || !strings.HasPrefix(term, "screen") { - // enable TrueColor in tmux, but not for old-school screen - return TrueColor + if strings.HasPrefix(term, "screen") { + // tmux supports TrueColor, screen only ANSI256 + if os.Getenv("TERM_PROGRAM") != "tmux" { + return ANSI256 + } } + return TrueColor case "yes": fallthrough case "true":