Skip to content

fix(psmux): IP/VPN pill renders blank — split text and colour into two options - #161

Merged
Gerrrt merged 1 commit into
mainfrom
claude/dotfiles-platform-parity-e63nxl
Aug 1, 2026
Merged

fix(psmux): IP/VPN pill renders blank — split text and colour into two options#161
Gerrrt merged 1 commit into
mainfrom
claude/dotfiles-platform-parity-e63nxl

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

What

The psmux operator/VPN pill (#{@vpn_pill} in status-left) never showed, even when psmux-pill-status reported a populated cache. Root cause: the pill was poked into psmux as a single pre-styled string:

set -g @vpn_pill '#[fg=#9ece6a,bold]<glyph> <ip>'

The bar reads #{@vpn_pill}, but an option value that embeds a #[…] style run is not re-interpreted when the format expands it — so the segment renders blank. The psmux-pill-status cache looked fine because that's written by a separate .NET File.WriteAllText code path (a plain file), independent of the psmux set poke the bar actually reads.

Fix

Split the transport to mirror the proven @tn_* colour pattern (which demonstrably works in this same status-left):

  • @vpn_pill now carries plain text only (glyph + address, no #[…]).
  • @vpn_fg carries the accent hex, applied in status-left as #[fg=#{@vpn_fg}]#{@vpn_pill} (orange = tunnel, green = LAN).
  • @vpn_fg is defaulted in the conf so #[fg=#{@vpn_fg}] is never empty on first paint / after a reload. Defaulting the colour is harmless (the refresher re-pokes the live one each cycle); only @vpn_pill's text must stay undefaulted to avoid clobbering the poked value.

psmux-netinfo.ps1 now pokes both options (colour first, then text) and stores the pill as plain text.

Files

  • psmux/scripts/psmux-netinfo.ps1Pill() stores plain text + accent; poke sets both @vpn_fg and @vpn_pill.
  • psmux/psmux.confstatus-left uses #[fg=#{@vpn_fg}]; added set -g @vpn_fg default + rationale comment.

Testing

Live on the author's Windows host:

psmux-pill-enable -AllNetworks    # arm the refresher + show plain-LAN IP
psmux-pill-now    -AllNetworks    # poke once, now
# inside psmux:  prefix + r        # force a repaint

The LAN IP should now appear in status-left (green glyph + address); on a VPN it shows the tunnel iface/addr in orange.

🤖 Generated with Claude Code


Generated by Claude Code

The operator/VPN pill was poked into psmux as a single pre-styled string:
  set -g @vpn_pill '#[fg=#9ece6a,bold]<glyph> <ip>'
The status bar reads #{@vpn_pill}, but an option VALUE that embeds a #[…]
style run is not re-interpreted when the format expands it — the segment
renders blank. That is why 'psmux-pill-status' showed a populated cache
(a plain FILE write, separate code path) while the bar stayed empty.

Split the transport to mirror the proven @tn_* colour pattern:
- @vpn_pill now carries PLAIN text only (glyph + address, no #[…]).
- @vpn_fg carries the accent hex, applied in status-left as
  #[fg=#{@vpn_fg}]#{@vpn_pill}. Defaulted in the conf so the colour is
  never empty on first paint / after a reload (harmless to default — only
  the text must not be defaulted, to avoid clobbering the poked value).

psmux-netinfo.ps1 pokes both options (colour first, then text).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016vBxayZLa4h9xhJiJxYVVZ
Copilot AI review requested due to automatic review settings August 1, 2026 04:12

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

Fixes the psmux operator/VPN status “pill” rendering blank by changing the transport from a single pre-styled option value to two separate options: one for plain text (@vpn_pill) and one for the accent colour (@vpn_fg). This aligns with the existing @tn_* palette usage pattern in psmux.conf and avoids relying on style runs embedded inside option values.

Changes:

  • Update psmux-netinfo.ps1 so Pill() stores plain text in @vpn_pill and separately pokes @vpn_fg for colour.
  • Update psmux.conf status-left to apply @vpn_fg as a style when rendering @vpn_pill.
  • Add a default @vpn_fg value in config (with rationale) to avoid empty fg= on first paint/reload.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
psmux/scripts/psmux-netinfo.ps1 Stores pill as plain text and pokes @vpn_fg + @vpn_pill separately for correct render behavior.
psmux/psmux.conf Renders pill using #[fg=#{@vpn_fg}] (and adds a default) so the bar can colourize the plain-text pill.

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

Comment thread psmux/psmux.conf
Comment on lines +263 to +270
# The pill's TEXT and its COLOUR are poked as two separate options: @vpn_pill (plain text,
# no #[…]) and @vpn_fg (accent hex, applied below as #[fg=#{@vpn_fg}]). They must stay split
# — a #[…] style run stuffed inside @vpn_pill is not re-interpreted on expansion and the
# segment renders blank (that was the "pill never shows" bug). Unlike @vpn_pill, @vpn_fg IS
# defaulted (harmless — it's just a colour; the refresher re-pokes the live one each cycle),
# so #[fg=#{@vpn_fg}] is never empty on the first paint or right after a reload.
set -g @vpn_fg "#9ece6a"
set -g status-left " #[fg=#{?client_prefix,#{@tn_orange},#{?pane_in_mode,#{@tn_yellow},#{@tn_blue}}},bold]#S#{?client_prefix, 󰠠 ,#{?pane_in_mode, 󰆏 , }}#[nobold,fg=#{@vpn_fg}]#{@vpn_pill}#[default] "

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Correct that the default is overwritten on reload — that tradeoff is deliberate, and the format-time fallback is the right eventual shape but not yet safe to adopt here:

  • Impact is narrow and self-healing. Green is the common-case (LAN) color, so the clobber only shows a wrong color when you're on a VPN (orange) and reload the config, and only until the next refresher tick (≤60s), which re-pokes the live color. No wrong color on a fresh session or on LAN.
  • The suggested fallback depends on an unverified psmux feature. #[fg=#{?@vpn_fg,#{@vpn_fg},#9ece6a}] needs psmux to support a truthiness conditional on a user option (#{?@vpn_fg,…}). This conf only documents what was actually probed on psmux 3.3.7 (status 2 / status-format[1] / centre / monitor-* / bg=default), and option-truthiness isn't on that list. After the monitor-bell regression (a CLI probe passed but the parser rejected the option), the bar's policy is to not put an unverified construct on the render path.

So I'm keeping the known-safe set -g @vpn_fg default for now. Once #{?@user_option,…} is confirmed on this psmux build, switching to the format-time fallback (dropping the default entirely) is a clean one-line follow-up.


Generated by Claude Code

@Gerrrt
Gerrrt merged commit 0c08de9 into main Aug 1, 2026
7 checks passed
@Gerrrt
Gerrrt deleted the claude/dotfiles-platform-parity-e63nxl branch August 1, 2026 05:03
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.

3 participants