Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneeszack

Relationships

#4478 run summary box: tabs, carriage returns and non-color escape codes in a value still misalign the border and reach the terminal

Opened by zack · 11/6/2026· Shipped 11/6/2026

Problem

After swamp-club#4471, every row of the summary box printed after swamp behavior run and swamp workflow run is cut to the box's 80-column limit by display width, and SGR color codes in data values are stripped. Other control characters still pass through to the terminal unmeasured:

  • A tab counts as zero columns but the terminal advances to the next tab stop, so a stdout attribute containing a tab pushes the right border out.
  • A value like a\r\nb keeps a trailing carriage return on its first line, so the ellipsis is drawn at column 0.
  • Non-SGR escape sequences (cursor movement, erase line, OSC 8 links) are neither stripped nor measured as the terminal draws them. Values such as captured stdout come from model output, so these also reach the user's terminal as live escapes.
  • Keys, artifact names and sources do not get the first-line handling values get, so a newline in one splits the row.

This was already true before #4471; it was left out of that change's scope. Both the code review and the UX review on that PR raised it.

Proposed solution

In src/presentation/output/console_writer.ts, sanitize all data-derived text (keys, values, names, sources) before it becomes a box segment: take the first line, replace tabs with a space, and drop remaining C0/C1 control characters and any escape sequence, not just SGR. Then widen the property test in console_writer_property_test.ts to generate control characters instead of filtering them out, since the current filter hides these cases.

Alternatives considered

Rendering control characters visibly (for example as \t or the replacement character) instead of dropping them. That would keep the data inspectable, at the cost of extra width.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 9 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

11/6/2026, 4:42:10 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
zack assigned zack11/6/2026, 3:50:53 PM

Sign in to post a ripple.