Repository navigation
refactor(styling): end bash-gutter lines at their content, not a reopened dim - #3056
Merged
Merged
Conversation
…ened dim format_bash_with_gutter reopened the dim base style after the last highlight token on each line ([0m[2m), immediately followed by the line's closing reset. Rendering was unaffected ([0m[2m[0m nets to a full reset), but committed snapshots hide line-final resets (the cross-platform filter in tests/common/mod.rs strips them), so gutter lines in .snap files ended [0m[2m and read as a dangling dim bleeding into the following announcement line. Strip the no-op tail in phase 2 so lines end at their content plus one closing reset. Also: - comment the snapshot filter that strips line-final resets, warning against diagnosing SGR bleed from .snap bytes - bind standard env redactions in config_show_theme: regenerating its snapshot leaked a host LLVM_PROFILE_FILE path and tripped test_no_host_specific_paths_in_snapshots - regenerate 108 snapshots; ANSI-stripped bodies are byte-identical, diffs are confined to line-end SGR sequences and stale env headers Co-Authored-By: Claude Fable 5 <[email protected]>
worktrunk-bot
approved these changes
Jun 12, 2026
The Windows test run caught the fish wrapper preview ending in a lone \r: askama strips a template's final newline, so on a CRLF checkout (autocrlf) the render ends `end\r`. The formatter's CRLF normalization only replaced \r\n pairs, so the \r reached tree-sitter, came back as a trailing token after the highlight closed, and defeated the end-of-line SGR cleanup — invisible historically because insta trims trailing whitespace when comparing snapshots. Trim trailing \r alongside \n. Also force LF checkout for templates/* in .gitattributes: the templates are embedded into the binary at compile time, so a CRLF checkout leaks \r into the shell code Windows-built binaries emit at runtime. Co-Authored-By: Claude Fable 5 <[email protected]>
worktrunk-bot
approved these changes
Jun 12, 2026
max-sixty
added a commit
that referenced
this pull request
Jun 14, 2026
The two wide colored-table snapshots were captured before merging main and missed two cosmetic changes the merge introduced: the per-row trailing ANSI reset (#3056/#3061) and dropped empty-valued env-header entries (#3037/#3063). Table content is unchanged; only the line-final `\x1b[0m` and the snapshot env block differ, matching every other wide list snapshot. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Dispatched to fix a reported ANSI dim-bleed after bash-gutter blocks: in committed snapshots, multi-command hook announcements appear to inherit an unclosed
[2mfrom the preceding gutter line (e.g.post_start_named_commands.snap, where the gutter line ends'Installing deps'[0m[2m).Diagnosis: the bleed doesn't exist in real output. Fresh
cat -vcaptures ofwt hook pre-merge --yesandwt switch --createwith two-key hook tables show every gutter line closing with a full[0m, and later◎ Running …lines rendering un-dimmed. The snapshots are misleading by construction: the cross-platform filter intests/common/mod.rsdeletes every line-final[0mbefore snapshotting, and the formatter reopens dim after the last highlight token before its per-line reset, so filtered snapshots end[0m[2mand read exactly like a dangling dim.The change removes that misleading byte pattern at the source: phase 2 of
format_bash_with_gutter_implstrips the no-op reopened dim (and the lone dim on blank lines) before appending each line's closing reset. Rendering is identical; lines now end at their content plus one reset.Also bundled:
.snapbytes.config_show_themenow binds the standard env redactions; regenerating its snapshot leaked a hostLLVM_PROFILE_FILEpath and trippedtest_no_host_specific_paths_in_snapshots(pre-existing gap, invisible until regeneration since insta never comparesinfo:blocks).env:header refreshes (RUST_LOG: warnfrom an older harness).Possible follow-up, not done here: the line-final-reset filter itself may be vestigial (anstream pass-through suggests piped output is identical across platforms now); removing it would make snapshots byte-truthful but churns nearly every snapshot and needs Windows CI to confirm.
The first Windows CI run caught a real latent bug the strip exposed: askama strips a template's final newline, so on a CRLF checkout (Windows autocrlf) the fish wrapper render ends with a lone
\rthat the formatter's pair-wise CRLF normalization missed. The\rreached tree-sitter and came back as a trailing token after the highlight closed, defeating the end-of-line cleanup (and historically invisible because insta trims trailing whitespace when comparing). Fixed by trimming trailing\rin the formatter's normalization, plustemplates/* text eol=lfin.gitattributessince CRLF templates embedded at compile time would leak\rinto the shell code Windows-built binaries emit at runtime.🤖 Generated with Claude Code