fix: TUIs follow mox's own color policy; origin marked by glyph shape - #28
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
TERMvalue it doesn't recognize, even on a terminal that renders SGR fine — which is why the whole hub was colorless except the preview pane (rawcapture-pane -epassthrough) whilemox list, which colors on its own TTY +NO_COLORcheck, stayed colored on the same terminal.The TUIs now pin lipgloss's global profile from the same policy
mox listuses (useColor): a terminal withNO_COLORunset 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 formox 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 withi, not startable/editable)○dim: stopped (always configured)The hub's row-level
tmuxtext tag from 0.6.0 is replaced by the glyph; the preview title keepstmux onlyas the explicit decoder, andmox listkeeps its ORIGIN column.Testing
TestTUIColorProfilepins the policy mapping (non-file writer, char device,NO_COLOR).TestNameCellGlyphspins the three glyph/color pairs inmox list;TestHubUnmanagedMarkernow asserts the◆on unmanaged hub rows.make testand golangci-lint v2 clean.termenvpromoted 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/moxbefore merging.