-
Notifications
You must be signed in to change notification settings - Fork 7
tmux-256color with COLORTERM=truecolor detected as ANSI256 instead of TrueColor #76
Copy link
Copy link
Open
Description
Bug description
envColorProfile() in env.go caps TERM values prefixed with tmux at ANSI256, even when COLORTERM=truecolor is set. The comment on line 187 says "Tmux doesn't support $COLORTERM", but modern tmux does — and many terminal emulators set COLORTERM=truecolor inside tmux sessions.
Setup
- OS: Linux (NixOS)
- Shell: zsh
- Terminal Emulator: various (ghostty, kitty, alacritty)
- Terminal Multiplexer: tmux 3.5a
- TERM:
tmux-256color - COLORTERM:
truecolor
Steps to reproduce
- Run inside tmux with
TERM=tmux-256colorandCOLORTERM=truecolor - Call
colorprofile.Detect(os.Stdout, os.Environ()) - Returns
ANSI256instead ofTrueColor
Expected behavior
When COLORTERM=truecolor is set, the profile should be TrueColor regardless of the TERM prefix. The COLORTERM variable is the standard way for terminals to advertise truecolor support.
Additional context
The Detect() function does have a tmux() fallback that queries tmux info for Tc/RGB capabilities, but envColorProfile() is called first in many code paths (e.g. via lipgloss.HasDarkBackground). Setting TERM=xterm-256color works around the issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels