You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Share one head-and-tail cutter between the dispatcher cap and bash pipes #696
Two head-and-tail cutters implement the same line-boundary rule separately. spill::cap_output cuts a String for the dispatcher cap, while render_pipe with ends_within, prefix_within, suffix_within, char_lens, and decoded_len cuts raw byte captures for bash output and predicts how long their lossy decoding will be. Decoding each captured head and tail with from_utf8_lossy before cutting, at most twice the pipe budget times three bytes per pipe, would let both paths share one string-level "keep within budget and snap to a line within LINE_SNAP_BYTES" helper and delete the decoded-length arithmetic.
Acceptance criteria
One helper implements the budget and LINE_SNAP_BYTES line-snapping rule for both the dispatcher cap and the bash pipes.
ends_within, prefix_within, suffix_within, char_lens, and decoded_len are gone.
The continuation-byte trimming at the head and tail seam happens before decoding, so a split character still cannot corrupt either end.
Every existing truncation and bash rendering test passes, with no snapshot or marker text change.
The pull request records the render cost of the added bounded allocation per pipe.
docs/design/truncation.md describes the shared rule once.
Notes
The rule and its 1 KiB window live in crates/ox-core/src/tool/spill.rs and crates/ox-core/src/tool/bash.rs. A cut beside a marker counts raw bytes its pipe dropped while the budget counts decoded bytes, so the shared helper has to keep those two notions separate.
Activity
fix(bash): interleave stdout and stderr in the order their writes arr…