You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In lib/internal/tty.js, getColorDepth() checks env.TMUX (line 174) before env.COLORTERM (line 215). When TMUX is set, it returns COLORS_256 (8) immediately, never reaching the COLORTERM === 'truecolor' check that would return COLORS_16m (24).
tmux has supported true color since v2.2 (2016). Modern tmux sets COLORTERM=truecolor when the outer terminal supports RGB via terminal-features or terminal-overrides. The current ordering ignores this.
Note: PR #30474 previously reordered COLORTERM before the TERM check but did not address the TMUX check ordering.
Move the COLORTERM truecolor/24bit check (line 215) before the TMUX check (line 174):
// Check COLORTERM first — tmux sets this when RGB is supportedif(env.COLORTERM==='truecolor'||env.COLORTERM==='24bit'){returnCOLORS_16m;}if(env.TMUX){returnCOLORS_256;}
This preserves the TMUX → 256 fallback for tmux sessions that don't have truecolor configured, while correctly returning 16m for those that do.
This issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
Following up on this — I looked into it, and it turns out this has already been fixed on main and released.
In PR #58146 (tty: improve color terminal color detection), the env.TMUX branch in lib/internal/tty.js was changed to return COLORS_16m (24) instead of COLORS_256 (8):
if(env.TMUX){returnCOLORS_16m;}
So getColorDepth() now returns 24 inside tmux. This shipped in v25.0.0, and there's already a regression test covering it in test/pseudo-tty/test-tty-color-support.js:
[{TMUX: '1'},24],
@jacobcxdev could you confirm which Node version you're on? If you're on v24 or earlier, upgrading to v25.0.0+ should resolve this. Given it's already fixed on main, I think this issue can be closed.
Activity
semimikoh commentedon Mar 24, 2026
Thanks for the detailed bug report! I'd like to work on fixing this issue.
My plan:
Is it okay if I submit a PR for this?
jacobcxdev commentedon Mar 24, 2026
@semimikoh yeah that's fine by me—thanks for taking it on!
github-actions commentedon Jul 20, 2026
This issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
jacobcxdev commentedon Jul 20, 2026
I believe this may still be relevant.
semimikoh commentedon Jul 21, 2026
Following up on this — I looked into it, and it turns out this has already been fixed on
mainand released.In PR #58146 (
tty: improve color terminal color detection), theenv.TMUXbranch inlib/internal/tty.jswas changed to returnCOLORS_16m(24) instead ofCOLORS_256(8):So
getColorDepth()now returns24inside tmux. This shipped in v25.0.0, and there's already a regression test covering it intest/pseudo-tty/test-tty-color-support.js:@jacobcxdev could you confirm which Node version you're on? If you're on v24 or earlier, upgrading to v25.0.0+ should resolve this. Given it's already fixed on
main, I think this issue can be closed.