Skip to content

fix: TUIs follow mox's own color policy; origin marked by glyph shape - #28

Merged
bthall merged 1 commit into
mainfrom
fix/tui-color-policy-and-origin-glyph
Jul 23, 2026
Merged

fix: TUIs follow mox's own color policy; origin marked by glyph shape#28
bthall merged 1 commit into
mainfrom
fix/tui-color-policy-and-origin-glyph

Conversation

@bthall

@bthall bthall commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

Root cause of the colorless hub, plus the agreed indicator redesign.

TUI color policy

The hub, editor, and add wizard render through lipgloss, which delegates color detection to termenv's environment sniffing. That sniffing returns no color at all for any TERM value it doesn't recognize, even on a terminal that renders SGR fine — which is why the whole hub was colorless except the preview pane (raw capture-pane -e passthrough) while mox list, which colors on its own TTY + NO_COLOR check, stayed colored on the same terminal.

The TUIs now pin lipgloss's global profile from the same policy mox list uses (useColor): a terminal with NO_COLOR unset gets color, everything else gets none. One color decision for the whole tool. Every TUI style uses the base 16-color palette, so this never emits anything the terminal hasn't already proven it can render for mox list.

Origin as shape + color

With colors reliable, the managed/unmanaged distinction becomes glyph shape shared across the hub and mox list:

  • green: running, in the config
  • yellow: running, tmux only (importable with i, not startable/editable)
  • dim: stopped (always configured)

The hub's row-level tmux text tag from 0.6.0 is replaced by the glyph; the preview title keeps tmux only as the explicit decoder, and mox list keeps its ORIGIN column.

Testing

  • TestTUIColorProfile pins the policy mapping (non-file writer, char device, NO_COLOR).
  • TestNameCellGlyphs pins the three glyph/color pairs in mox list; TestHubUnmanagedMarker now asserts the on unmanaged hub rows.
  • Written failing first; make test and golangci-lint v2 clean. termenv promoted to a direct dependency (already in the tree via lipgloss).

One caveat: I could not reproduce the colorless hub in this environment (PTY probes with the same TERM/COLORTERM detect TrueColor), so the exact env quirk on the affected terminal is unconfirmed. The fix removes the entire failure class by not consulting TERM at all. Please eyeball ./build/mox before merging.

The hub, editor, and add wizard render through lipgloss, whose default
termenv sniffing returns no-color for TERM values it doesn't recognize,
silently stripping every style while mox list (own TTY + NO_COLOR
policy) stays colored on the same terminal. The TUIs now pin lipgloss's
profile from the same policy mox list uses.

With colors reliable, the managed/unmanaged distinction moves to shape
plus color, shared across hub and mox list: yellow diamond for a session
running outside the config, green dot for a running configured session,
dim circle for stopped. The hub's row-level "tmux" text tag is replaced
by the glyph; the preview title keeps "tmux only" as the decoder.
@bthall
bthall merged commit c16877f into main Jul 23, 2026
5 checks passed
@bthall
bthall deleted the fix/tui-color-policy-and-origin-glyph branch July 23, 2026 14:36
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.

1 participant