tmux: enable truecolor + focus-events for TUI apps

- Switch default-terminal from screen-256color to tmux-256color
  (better italics/undercurl/SGR support for nvim, Claude Code, etc.)
- Add terminal-features RGB for the common outer terminals so
  truecolor escape sequences pass through cleanly
- Enable focus-events so inner programs can redraw when the pane
  regains focus
This commit is contained in:
2026-05-06 09:37:20 +00:00
parent f27ba2710e
commit 6188583ee9

View File

@@ -2,7 +2,20 @@
set -g bell-action any set -g bell-action any
# Default termtype. If the rcfile sets $TERM, that overrides this value. # Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color set -g default-terminal "tmux-256color"
# Truecolor + clipboard passthrough for outer terminals that advertise RGB
# (covers xterm-*, alacritty, kitty, wezterm, iTerm, ghostty, modern Apple Terminal).
set -ga terminal-features ",xterm-256color:RGB"
set -ga terminal-features ",alacritty:RGB"
set -ga terminal-features ",kitty:RGB"
set -ga terminal-features ",wezterm:RGB"
set -ga terminal-features ",ghostty:RGB"
set -ga terminal-features ",screen-256color:RGB"
# TUI apps (Claude Code, nvim, etc.) want focus events so they can redraw
# / refresh state when the pane regains focus.
set -g focus-events on
# Keep your finger on ctrl, or don't # Keep your finger on ctrl, or don't
bind-key ^D detach-client bind-key ^D detach-client