Skip to content
67 changes: 67 additions & 0 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,73 @@ its text block `subtle` (grey fill, accent text), so the two halves stand apart.
| --- | --- | --- |
| `@themux_theme` | `catppuccin_mocha` | Palette: `catppuccin_{latte,frappe,macchiato,mocha}`, `kanagawa_{wave,dragon,lotus}`, or `kanso_{zen,ink,mist,pearl}`. Loads `themes/<theme>.palette` (or a legacy `_tmux.conf`), which exposes the `@thm_*` colors. |

### Colour roles

Module accents default to **six semantic roles**, not raw palette slots. Each
role maps to one `@thm_*` colour once; every module that accents through a role
follows that one mapping, so a single override re-colours every module that
shares the role instead of you hand-editing each one.

| Role | Default palette slot | Meaning |
| --- | --- | --- |
| `@thm_role_accent` | `@thm_green` | Primary/VCS-family accent (git, session). |
| `@thm_role_info` | `@thm_sapphire` | Informational/system modules (directory, host, load, date/time, kube). |
| `@thm_role_notice` | `@thm_peach` | Attention without alarm (dirty git, weather/clima, pomodoro). |
| `@thm_role_muted` | `@thm_lavender` | Low-priority/background info (battery). |
| `@thm_role_alert` | `@thm_yellow` | Draws the eye, not an error (session prefix held, zoom). |
| `@thm_role_error` | `@thm_red` | Reserved for genuine error states (not assigned to any built-in module by default). |

Roles are `-ogq` options, so **set them before the plugin loads** (same rule as
every other themux option) to override the default:

```sh
set -g @thm_role_info "#{E:@thm_blue}" # re-colour every info-family module at once
```

Each role's stored value is itself a palette reference (`#{E:@thm_<slot>}`), not
a frozen hex, so it keeps tracking a theme switch exactly like `@thm_*` does. A
module's `_color` (and related `_active_color` / `_context_color` /
`_namespace_color`) options now default to `#{E:@thm_role_<name>}` instead of a
raw `#{E:@thm_<slot>}` — set `@themux_<name>_color` (or the per-slot variant) as
usual to override a single module without touching its role.

> [!WARNING]
> **Breaking change:** module accent defaults changed in this release — see the
> full list below.
>
> | Module option | Old default | New default | Visible colour change |
> | --- | --- | --- | --- |
> | `@themux_git_color`, `@themux_gitmux_color` | `@thm_teal` | `@thm_role_accent` (green) | Yes |
> | `@themux_git_active_color` | `@thm_peach` | `@thm_role_notice` (peach) | No (same hex) |
> | `@themux_session_color` | `@thm_green` | `@thm_role_accent` (green) | No (same hex) |
> | `@themux_session_active_color` | `@thm_red` | `@thm_role_alert` (yellow) | Yes |
> | `@themux_clima_color`, `@themux_weather_color` | `@thm_yellow` | `@thm_role_notice` (peach) | Yes |
> | `@themux_battery_color` | `@thm_lavender` | `@thm_role_muted` (lavender) | No (same hex) |
> | `@themux_kube_color` | `@thm_blue` | `@thm_role_info` (sapphire) | Yes |
> | `@themux_kube_context_color` | `@thm_red` | `@thm_role_info` (sapphire) | Yes |
> | `@themux_directory_color` | `@thm_blue` | `@thm_role_info` (sapphire) | Yes |
> | `@themux_load_color` | `@thm_blue` | `@thm_role_info` (sapphire) | Yes |
> | `@themux_host_color` | `@thm_mauve` | `@thm_role_info` (sapphire) | Yes |
> | `@themux_date_time_color` | `@thm_sapphire` | `@thm_role_info` (sapphire) | No (same hex) |
> | `@themux_time_color` | `@thm_sky` | `@thm_role_info` (sapphire) | Yes |
> | `@themux_zoom_color` | `@thm_yellow` | `@thm_role_alert` (yellow) | No (same hex) |
> | `@themux_pomodoro_plus_color` | `@thm_peach` | `@thm_role_notice` (peach) | No (same hex) |
>
> Even where the resolved colour is unchanged, the *option's stored value*
> changed from a raw `@thm_*` reference to a `@thm_role_*` reference — if you
> read that raw value back (rather than the rendered colour), account for it.
>
> **Not remapped (intentional):** `@themux_kube_namespace_color` keeps
> `@thm_sky` (an info-family nuance, kept distinct from `@themux_kube_context_color`).
> `@themux_application_color` keeps `@thm_maroon` (no equivalent role — there is
> nothing else in the "primary command" family to unify it with). `cpu`/`ram`
> keep tmux-cpu's live green→yellow→red level-colour escalation untouched — a
> role is a static per-theme mapping, and a live threshold cannot be modelled as
> one; see [Status modules](#status-modules). `@themux_user_color` and
> `@themux_uptime_color` default to `@thm_role_info` like the other neutral-data
> modules (for `user` that shifts the default from `@thm_sky` to the info role's
> sapphire; `uptime` was already sapphire, so only the semantics change).

### Component props — per item

Each item is styled by independent props, so any combination is valid: the
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/status-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ through the module active state, so the pill warms natively under any variant
and always agrees with the text.

```sh
set -g @themux_git_color "#{E:@thm_teal}" # resting (clean)
set -g @themux_git_active_color "#{E:@thm_peach}" # dirty
set -g @themux_git_color "#{E:@thm_role_accent}" # resting (clean)
set -g @themux_git_active_color "#{E:@thm_role_notice}" # dirty
set -g @themux_git_symbol_clean "✓"
set -g @themux_git_symbol_dirty "!"
```
Expand Down Expand Up @@ -297,7 +297,7 @@ run '~/.config/tmux/plugins/tpm/tpm'
**Configure:**

```sh
set -g @themux_kube_context_color "#{@thm_red}"
set -g @themux_kube_context_color "#{E:@thm_role_info}"
set -g @themux_kube_namespace_color "#{@thm_sky}"

set -g @themux_status_line_1 "windows / kube"
Expand Down
2 changes: 1 addition & 1 deletion modules/battery.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set -ogq @batt_icon_status_attached "󱈑"

set -ogq "@themux_${MODULE_NAME}_icon" "#{l:#{battery_icon}}"
set -ogq "@themux_${MODULE_NAME}_label" "bat"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_lavender}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_muted}"
set -ogq "@themux_${MODULE_NAME}_text" "#{l:#{battery_percentage}}"

# tmux-battery only resolves #{battery_*} into status-left/right; mark the module
Expand Down
2 changes: 1 addition & 1 deletion modules/clima.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set -ogq "@themux_${MODULE_NAME}_icon" ""
set -ogq "@themux_${MODULE_NAME}_label" "clima"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_yellow}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_notice}"
set -ogq "@themux_${MODULE_NAME}_text" "#{l:#{clima}}"

# Resolve the plugin's #{clima} literal in any status-line zone (see layout.sh).
Expand Down
2 changes: 1 addition & 1 deletion modules/date_time.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%hidden MODULE_NAME="date_time"

set -ogq "@themux_${MODULE_NAME}_icon" "󰃰"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_sapphire}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_info}"
set -ogq "@themux_${MODULE_NAME}_text" "%Y-%m-%d %H:%M"

source -F "#{d:current_file}/../utils/module_block.conf"
2 changes: 1 addition & 1 deletion modules/directory.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%hidden MODULE_NAME="directory"

set -ogq "@themux_${MODULE_NAME}_icon" "󰉋"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_blue}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_info}"
set -ogq "@themux_${MODULE_NAME}_text" "#{b:pane_current_path}"

source -F "#{d:current_file}/../utils/module_block.conf"
4 changes: 2 additions & 2 deletions modules/git.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# styled like any other module and every prop (variant, shape, padding,
# leading_position) keeps working. No external binary required.
set -ogq "@themux_${MODULE_NAME}_icon" "󰊢"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_teal}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_accent}"
set -ogq "@themux_${MODULE_NAME}_symbol_clean" "✓"
set -ogq "@themux_${MODULE_NAME}_symbol_dirty" "!"

Expand All @@ -18,7 +18,7 @@ set -gq "@themux_${MODULE_NAME}_text" ' #("#{E:@_tmx_git_script}" "#{pane_curren
# A dirty work tree warms the accent through the shared active machinery: the
# probe prints 1 or 0 (tmux reads the string "0" as false) and checks any
# change — tracked or untracked — so the accent always agrees with the text.
set -ogq "@themux_${MODULE_NAME}_active_color" "#{E:@thm_peach}"
set -ogq "@themux_${MODULE_NAME}_active_color" "#{E:@thm_role_notice}"
set -gq "@_tmx_${MODULE_NAME}_dirty" '#("#{E:@_tmx_git_script}" --dirty "#{pane_current_path}")'
set -ogq "@themux_${MODULE_NAME}_active_when" "#{E:@_tmx_${MODULE_NAME}_dirty}"

Expand Down
2 changes: 1 addition & 1 deletion modules/gitmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Requires https://github.com/arl/gitmux (uses gitmux's own defaults).
set -ogq "@themux_${MODULE_NAME}_icon" "󰊢"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_teal}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_accent}"
set -gq "@themux_${MODULE_NAME}_text" ' #(gitmux "#{pane_current_path}")'

# gitmux paints its own segments and resets the background between them (#[none],
Expand Down
2 changes: 1 addition & 1 deletion modules/host.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%hidden MODULE_NAME="host"

set -ogq "@themux_${MODULE_NAME}_icon" "󰒋"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_mauve}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_info}"
set -ogq "@themux_${MODULE_NAME}_text" "#H"

source -F "#{d:current_file}/../utils/module_block.conf"
4 changes: 2 additions & 2 deletions modules/kube.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

set -ogq "@themux_${MODULE_NAME}_icon" "󱃾"
set -ogq "@themux_${MODULE_NAME}_label" "kube"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_blue}"
set -ogq "@themux_kube_context_color" "#{E:@thm_red}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_info}"
set -ogq "@themux_kube_context_color" "#{E:@thm_role_info}"
set -ogq "@themux_kube_namespace_color" "#{E:@thm_sky}"
set -ogq "@themux_${MODULE_NAME}_text" \
" #{l:#[fg=#{@themux_kube_context_color}]#{kubectx_context}#[fg=default]:#[fg=#{@themux_kube_namespace_color}]#{kubectx_namespace}}"
Expand Down
2 changes: 1 addition & 1 deletion modules/load.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set -ogq "@themux_${MODULE_NAME}_icon" "󰊚"
set -ogq "@themux_${MODULE_NAME}_label" "load"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_blue}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_info}"
set -ogq "@themux_${MODULE_NAME}_text" "#(uptime | awk '{split(substr($0, index($0, \"load\")), a, \":\"); print a[2]}')"

source -F "#{d:current_file}/../utils/module_block.conf"
2 changes: 1 addition & 1 deletion modules/pomodoro_plus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set -ogq "@themux_${MODULE_NAME}_icon" ""
set -ogq "@themux_${MODULE_NAME}_label" "pomo"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_peach}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_notice}"
set -ogq "@themux_${MODULE_NAME}_text" "#{l:#{pomodoro_status}}"

# Resolve the plugin's #{pomodoro_status} literal in any status-line zone (layout.sh).
Expand Down
6 changes: 3 additions & 3 deletions modules/session.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
%hidden MODULE_NAME="session"

set -ogq "@themux_${MODULE_NAME}_icon" ""
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_green}" # resting (no prefix)
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_accent}" # resting (no prefix)
set -ogq "@themux_${MODULE_NAME}_text" "#S"

# While the prefix is held the selected state target takes a red accent:
# While the prefix is held the selected state target takes the alert accent:
# auto keeps it on the visible leading slot, or text/both/off can force it.
set -ogq "@themux_${MODULE_NAME}_active_color" "#{E:@thm_red}"
set -ogq "@themux_${MODULE_NAME}_active_color" "#{E:@thm_role_alert}"
set -ogq "@themux_${MODULE_NAME}_active_when" "client_prefix"

source -F "#{d:current_file}/../utils/module_block.conf"
2 changes: 1 addition & 1 deletion modules/time.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Clock-only counterpart to date_time: just the time, no date.
set -ogq "@themux_${MODULE_NAME}_icon" ""
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_sky}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_info}"
set -ogq "@themux_${MODULE_NAME}_text" "%H:%M"

source -F "#{d:current_file}/../utils/module_block.conf"
2 changes: 1 addition & 1 deletion modules/uptime.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set -ogq @themux_${MODULE_NAME}_icon "󰔟"
set -ogq "@themux_${MODULE_NAME}_label" "uptime"
set -ogq @themux_${MODULE_NAME}_color "#{E:@thm_sapphire}"
set -ogq @themux_${MODULE_NAME}_color "#{E:@thm_role_info}"
set -ogq @themux_${MODULE_NAME}_text "#(uptime | sed 's/^[^,]*up *//; s/, *[[:digit:]]* user.*//; s/ day.*, */d /; s/ hr\\(s*\\).*/h/; s/ min\\(s*\\).*/m/; s/ sec\\(s*\\).*/s/; s/\\([0-9]\\{1,2\\}\\):\\([0-9]\\{1,2\\}\\)/\\1h \\2m/;')"

source -F "#{d:current_file}/../utils/module_block.conf"
2 changes: 1 addition & 1 deletion modules/user.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%hidden MODULE_NAME="user"

set -ogq @themux_${MODULE_NAME}_icon ""
set -ogq @themux_${MODULE_NAME}_color "#{E:@thm_sky}"
set -ogq @themux_${MODULE_NAME}_color "#{E:@thm_role_info}"
set -ogq @themux_${MODULE_NAME}_text "#(whoami)"

source -F "#{d:current_file}/../utils/module_block.conf"
2 changes: 1 addition & 1 deletion modules/weather.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -ogq @themux_${MODULE_NAME}_icon ""
set -ogq "@themux_${MODULE_NAME}_label" "weather"
set -ogq @themux_${MODULE_NAME}_color "#{E:@thm_yellow}"
set -ogq @themux_${MODULE_NAME}_color "#{E:@thm_role_notice}"
set -ogq @themux_${MODULE_NAME}_text "#{l:#{weather}}"

# Resolve the plugin's #{weather} literal in any status-line zone (see layout.sh).
Expand Down
2 changes: 1 addition & 1 deletion modules/zoom.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%hidden MODULE_NAME="zoom"

set -ogq "@themux_${MODULE_NAME}_icon" ""
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_yellow}"
set -ogq "@themux_${MODULE_NAME}_color" "#{E:@thm_role_alert}"
set -ogq "@themux_${MODULE_NAME}_text" "zoom"

# The zoom module only renders while the active pane is zoomed; module_render.sh
Expand Down
1 change: 1 addition & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)

"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/application_module.sh --expected "${script_dir}"/tests/application_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/battery_module.sh --expected "${script_dir}"/tests/battery_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/color_roles.sh --expected "${script_dir}"/tests/color_roles_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/cpu_module.sh --expected "${script_dir}"/tests/cpu_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/git_module.sh --expected "${script_dir}"/tests/git_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/load_module.sh --expected "${script_dir}"/tests/load_module_expected.txt "$@"
Expand Down
113 changes: 113 additions & 0 deletions tests/color_roles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/usr/bin/env bash

script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
# shellcheck disable=SC1091
source "${script_dir}/helpers.sh"

core() { tmux show -gqv "@_tmx_module_$1_core"; }
core_e() { tmux display -p "#{E:@_tmx_module_$1_core}"; } # expanded: state routed, live colour in its final slot
src() {
tmux source "${script_dir}/../themux_options.conf"
tmux source "${script_dir}/../themux.conf"
}

# --- 1. The six roles exist and resolve, through the EXPANDED #{E:} core (not
# the raw ref), to catppuccin-mocha's default palette hex. ------------------
tmux set -g @themux_status_line_1 "directory host date_time time load kube session zoom"
src

printf "role_accent "; tmux display -p '#{E:@thm_role_accent}'
printf "\nrole_info "; tmux display -p '#{E:@thm_role_info}'
printf "\nrole_notice "; tmux display -p '#{E:@thm_role_notice}'
printf "\nrole_muted "; tmux display -p '#{E:@thm_role_muted}'
printf "\nrole_alert "; tmux display -p '#{E:@thm_role_alert}'
printf "\nrole_error "; tmux display -p '#{E:@thm_role_error}'

# The stored option is a #{E:@thm_x} REF, not a flattened hex (mechanism (a) —
# see themux.conf) — so it keeps tracking a theme switch instead of freezing.
printf "\nrole_info_raw_is_ref "
{ tmux show -gqv @thm_role_info | grep -qF '#{E:@thm_sapphire}'; } && printf "Y" || printf "n"

# --- 2. A real module accent renders with the role's colour through the real
# module render path (module_render.sh's acc()/bake(), not a synthetic probe).
# kube changed blue -> role_info AND has three colour-bearing options; only its
# icon block (@themux_kube_color) actually routes through acc()/bake() into the
# baked core below. @themux_kube_context_color/_namespace_color are composed by
# hand inside an #{l:...} (literal, never-expanded) block in @themux_kube_text —
# a PRE-EXISTING characteristic of kube.conf, unrelated to and unchanged by the
# colour-role work (confirmed unchanged before/after: #{@themux_kube_context_color}
# leaks into @_tmx_module_kube_core's EXPANDED core literally either way). So this
# only exercises the icon block through the real render path, and separately
# confirms the two text-only options still got the correct role default assigned.
printf "\nkube_icon_role_info "
{ core kube | grep -qF 'bg=#74c7ec'; } && printf "Y" || printf "n"
printf "\nkube_context_color_is_role_info "
{ tmux show -gqv @themux_kube_context_color | grep -qF '@thm_role_info'; } && printf "Y" || printf "n"
printf "\nkube_namespace_color_untouched "
{ tmux show -gqv @themux_kube_namespace_color | grep -qF '@thm_sky'; } && printf "Y" || printf "n"

# --- 3. Single mapping point: overriding @thm_role_info re-colours every
# info-family module at once (directory, host, date_time, time, load, kube). ---
before_directory=$(core directory)
tmux set -g @thm_role_info "#{E:@thm_red}"
src
printf "\noverride_propagates_directory "
{ core directory | grep -qF 'bg=#f38ba8' && ! echo "$before_directory" | grep -qF 'bg=#f38ba8'; } && printf "Y" || printf "n"
printf "\noverride_propagates_host "
{ core host | grep -qF 'bg=#f38ba8'; } && printf "Y" || printf "n"
printf "\noverride_propagates_date_time "
{ core date_time | grep -qF 'bg=#f38ba8'; } && printf "Y" || printf "n"
printf "\noverride_propagates_time "
{ core time | grep -qF 'bg=#f38ba8'; } && printf "Y" || printf "n"
printf "\noverride_propagates_load "
{ core load | grep -qF 'bg=#f38ba8'; } && printf "Y" || printf "n"
printf "\noverride_propagates_kube "
{ core kube | grep -qF 'bg=#f38ba8'; } && printf "Y" || printf "n"
tmux set -gu @thm_role_info
src

# --- 4. cpu/ram keep their live level-colour escalation; they are NOT wired to
# any @thm_role_* (deliberate divergence — see modules/cpu.conf, ram.conf). -----
tmux set -g @themux_status_line_1 "cpu ram"
src
printf "\ncpu_low_color_not_role_driven "
{ ! tmux show -gqv @themux_cpu_low_color | grep -q 'role'; } && printf "Y" || printf "n"
printf "\nram_low_color_not_role_driven "
{ ! tmux show -gqv @themux_ram_low_color | grep -q 'role'; } && printf "Y" || printf "n"
printf "\ncpu_live_escalation_still_wired "
core_e cpu | { grep -o 'cpu_bg_color' || true; } | wc -l | tr -d ' '
printf "\nram_live_escalation_still_wired "
core_e ram | { grep -o 'ram_bg_color' || true; } | wc -l | tr -d ' '

# --- 5. session's active-prefix accent is now role_alert (yellow), not the old
# hardwired red. --------------------------------------------------------------
tmux set -g @themux_status_line_1 "session"
src
printf "\nsession_active_color_is_role_alert "
{ tmux show -gqv @themux_session_active_color | grep -qF '@thm_role_alert'; } && printf "Y" || printf "n"
printf "\nsession_active_prefix_hex "
tmux display -p '#{E:@themux_session_active_color}'
printf "\nsession_resting_color_is_role_accent "
{ tmux show -gqv @themux_session_color | grep -qF '@thm_role_accent'; } && printf "Y" || printf "n"

# --- 6. Reload/theme-switch path: a role re-derives from the NEW theme's
# palette after a reset (unset @thm_*/_tmx_*, then re-source). The unset
# pattern below mirrors themux.tmux's own internal reset block, which is the
# production path that re-establishes the palette on load.
# The real @themux_reload_key path (utils/reset.sh) reaches the same block:
# it re-sources the user's config, which re-runs themux.tmux, whose internal
# guard unsets @thm_*/@_tmx_* and re-derives palette and roles — so a
# mid-session theme switch works through it too. The harness has no user
# config to re-source, so this test drives the equivalent reset directly. ---
before_role_info=$(tmux display -p '#{E:@thm_role_info}')
tmux set -g @themux_theme "kanagawa_wave"
reset_args=()
add() { [ ${#reset_args[@]} -eq 0 ] || reset_args+=(';'); reset_args+=("$@"); }
while read -r o; do add set -gu "$o"; done \
< <(tmux show -g | awk '$1 ~ /^@(thm_|_tmx_)/ { print $1 }')
[ ${#reset_args[@]} -gt 0 ] && tmux "${reset_args[@]}"
src
after_role_info=$(tmux display -p '#{E:@thm_role_info}')
printf "\ntheme_switch_reresolves_role "
{ [ "$before_role_info" != "$after_role_info" ]; } && printf "Y" || printf "n"
printf "\n"
Loading