Skip to content

fix(tmux): use tmux-256color and declare RGB per outer terminal - #10

Merged
ptaranat merged 1 commit into
mainfrom
fix/tmux-truecolor
Sep 22, 2026
Merged

ptaranat merged 1 commit into
mainfrom
fix/tmux-truecolor

Conversation

@ptaranat

Copy link
Copy Markdown
Owner

default-terminal was xterm-256color, a terminfo that describes something
tmux is not, so it misreported capabilities (e.g. italics) to programs in
the panes. Switch to tmux-256color, the entry that actually describes tmux.

tmux-256color does not advertise Tc/RGB on its own, so that switch alone
would have downgraded srcery's 24-bit colours to the 256-colour approximation
and stopped nvim matching the tmux status bar. terminal-features is keyed on
the OUTER terminal, so declare RGB for each one actually used (ghostty,
kitty), appended with -as to keep tmux's built-in feature table.

Verified in a fresh pane: TERM=tmux-256color, COLORTERM=truecolor, and a
24-bit escape emitted as 38;2;252;232;195 matching srcery #FCE8C3.

ptaranat commented Jul 20, 2026

Copy link
Copy Markdown
Owner Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the tmux configuration to accurately report terminal capabilities inside tmux by switching the internal $TERM to tmux-256color, and restores truecolor (24-bit) support by explicitly declaring RGB capability per outer terminal.

Changes:

  • Set tmux’s default-terminal to tmux-256color to avoid misreporting capabilities (e.g., italics) to applications inside panes.
  • Append per-outer-terminal terminal-features entries to advertise truecolor (RGB) for xterm-ghostty and xterm-kitty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

default-terminal was xterm-256color, a terminfo that describes something
tmux is not, so capabilities (notably italics) were misreported to programs
running in the panes. tmux-256color is the entry that actually describes tmux.

Switching it alone would have regressed colour. terminal-features is keyed on
the OUTER terminal's name rather than default-terminal, and tmux-256color does
not advertise RGB itself, so the existing xterm-256color:RGB line only ever
matched Windows Terminal on the WSL box. Ghostty and kitty on the mac report
xterm-ghostty and xterm-kitty and were never covered, which is why srcery's
24-bit colours quantised there. All three are now listed.

The hyperlinks, extended-keys and focus-events settings are untouched.

ncurses-term is pinned in .chezmoidata.yaml because Debian's ncurses-base
ships only a minimal terminfo set without tmux-256color, and tmux would fail
to start on the WSL box without it. macOS ships the entry already.

Verified by loading the config on a scratch tmux socket: default-terminal
resolves to tmux-256color and the three RGB features sit alongside tmux's
built-in feature table rather than replacing it.
@ptaranat
ptaranat changed the base branch from fix/zsh-orbstack-jetbrains to main September 22, 2026 15:49
@ptaranat

Copy link
Copy Markdown
Owner Author

Reworked onto the current main and retargeted from fix/zsh-orbstack-jetbrains to main.

The original branch was cut before main was rewritten, so it predated the hyperlinks, extended-keys and focus-events settings that landed upstream in 6c30638. Rather than replace upstream's approach, this now combines both:

  • default-terminal tmux-256color (from this branch) for correct capability reporting
  • RGB declared for xterm-ghostty and xterm-kitty (this branch, covers the mac) and xterm-256color (upstream, covers Windows Terminal on WSL)
  • upstream's hyperlinks, extended keys and focus events left untouched

The two fixes turned out to be complementary, not competing: terminal-features matches on the outer terminal's TERM, so upstream's xterm-256color:RGB line never matched under Ghostty on the mac.

Scope change worth a look: this also pins ncurses-term in .chezmoidata.yaml. Debian's ncurses-base does not ship the tmux-256color entry, so without it tmux would fail to start on the WSL box. macOS already has it.

Verified by loading the config on a scratch tmux socket: default-terminal resolves correctly and the three RGB features append to tmux's built-in feature table rather than replacing it.

@ptaranat
ptaranat merged commit 55739d2 into main Sep 22, 2026
@ptaranat
ptaranat deleted the fix/tmux-truecolor branch September 22, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants