feat!: directional notch — zone-aware auto, per-item direction - #11
Merged
Merged
Conversation
_expand modules (cpu/ram) baked a live #{l:...} colour ref into their
notch seam, but the seam was bash-spliced into the core AFTER the
core's own #{E:} expansion + interp pass, so the seam's #{l:} wrapper
was never peeled and its fg stayed a dead literal — the dark notch
triangle on cpu/ram. Route the seam through the same #{E:} expansion
the core gets, splice, then interp both together.
Also fix a related leak: the splice was skipped whenever the
replacement text was empty (e.g. centre zone's default middle
separator), but auto mode always bakes the marker regardless of the
replacement — skip the splice only when no marker was baked at all,
never merely because the replacement is empty, or the raw NOTCH_MARK
control byte leaks into the drawn status line.
position=left already wrapped its name block (and notch seam) inside
the #{?${text},...,} name-visibility conditional, but the newly added
position=right path emitted its seam unconditionally after the name
content. A window whose name resolves empty at draw time then showed
a floating seam taper with nothing to taper into. Wrap the
position=right name content and seam in the same conditional.
window_status_styling_expected.txt is updated for the same reason: it
captured the previously-unconditional position=right output.
Document that the squared shape draws the same full-block glyph for both notch directions (only the colour placement differs), and that auto/on only resolve through the layout grammar — a module consumed directly (a user's own tmux format, or _prepend/_append) never gets its marker spliced. tmux's status-line renderer silently drops that byte at draw time, so the seam is simply absent, as if notch were off. Also update tests/module_variant.sh's stale notch comment: under the current design its length assertion only measures the RAW core's marker-vs-empty byte, not a rendered glyph's width; real glyph coverage lives in tests/notch_direction.sh.
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
Extends the
notchprop (the seam between an item's leading and text blocks) from a boolean to a directional grammar, consistent with the status-line seam alphabet (><=):@themux_all_notch off | > | < | auto(cascadable per item/module as before).>keeps today's look (left block penetrates right, right-cap glyph);<is the mirror (left-cap glyph, colours swapped).autoresolves per placement: modules and the window list by status-line zone (left →>, right →<, centre → off); panes byleading_position. The same module in two zones resolves each occurrence independently.onis now an alias ofauto— in a right zone it draws<, in the centre nothing (it previously always drew>).auto: windows and panes had no seam path at all forleading_position right, and the pane seam used the raw block bg for its fg with no accent fallback (invisible seam on naked leading).Mechanism
Renderers are zone-agnostic, so under
autothe module renderer bakes an RS control-byte marker plus per-direction seam chunks, andlayout.shsplices per occurrence — a draw-time#{s///:}for ref-consumed modules, a bash splice through the#{E:}+interp pipeline for_expandmodules (a literal%NOTCH%-style marker is unsafe: tmux strftime-expands any text passing through#{E:}). The window list uses a draw-time dispatch on a hidden option set by layout (last occurrence wins, documented). Explicit>/</offbake directly with zero added cost.Changes
utils/render_style.shthemux_notch_mode()— shared value normalizer (on→auto, unknown→off)utils/module_render.sh@_tmx_module_<name>_seam_{gt,lt}underautoutils/layout.shalign) intofull_pill/powerline_run/mod_core; per-occurrence seam splice;_expandseams routed through the expand pipeline;@_tmx_window_notch_dirwiringutils/window_render.shautodispatch; seam gated on name visibilityutils/pane_render.shautoresolution; newposition=rightseam path; seam fg accent-fallback fixthemux_options.conf,docs/,README.mdoncallout, squared colours-only note, direct-consumption caveattests/notch_direction.sh(+expected)_expandliveness, marker-leak regressionsTest plan
tests/run_tests.sh— 15/15 (14 existing + newnotch_direction), no regressionsshellcheckclean on all touched scripts