nekolas note
1.5 KB Raw
# cc-tmux: tmux 表示スニペット(T011)。
# 参照: contracts/tmux-display.md
#
# per-window ユーザーオプション:
#   @cc_state  busy のとき赤、その他は既定色
#   @cc_spin   非空ならタブ名の「左」にスピナー1文字 + 空白を表示
#
# インストーラが ~/.tmux.conf に `run-shell '<dir>/tmux/cc-tmux.tmux'` を追記する。
#
# 色について(tmux.1 STYLES 準拠, ../../docs/tmux-styles.md 参照):
#   fg=brightred は「前景=文字色」を明るい赤にする(bg=背景色は一切使わない)。busy=赤い文字。
#   アクティブタブの背景色は window-status-current-style(テーマ)由来で本スニペットは変更しない。
#   brightred はアクティブタブの背景色(テーマの緑など)の上でも視認しやすいよう通常 red より明るい赤。
#
# 注意: スピナーの実効更新は tmux ステータス再描画スロットルにより ~1fps(research R4)。

# 通常タブ: スピナー(左)+ busy 時 fg=brightred(明るい赤の文字)。
set -g window-status-format "#{?#{==:#{@cc_spin},},,#{@cc_spin} }#{?#{==:#{@cc_state},busy},#[fg=brightred],}#I:#W#[default]"

# 現在タブ: busy 時は明るい赤の太字。背景はテーマ(current-style)のまま。
set -g window-status-current-format "#{?#{==:#{@cc_spin},},,#{@cc_spin} }#{?#{==:#{@cc_state},busy},#[fg=brightred bold],}#I:#W#[default]"

# スピナー更新を素早く反映させるため 1 秒間隔で再描画。
set -g status-interval 1