fix(rawcli): drop extra blank line between trace lines

The trace formatter's line now carries a trailing newline; rawcli was
stripping only a leading one (.lstrip), so the trailing \n survived and
the printer added another -> a blank line between every trace line (and a
\n\n join inside render_exchange). Use .strip("\n") so it's correct
whether the formatter emits a leading or trailing newline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
michael
2026-07-14 12:52:33 -07:00
parent 41db552e05
commit 7703b638f3
2 changed files with 5 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ def render_exchange(command: bytes, response: bytes | None, *,
if present, a ``Tag → Reader`` line for ``response``. ``is_tty`` forces/suppresses ANSI."""
decoder, crc_len = _PROTOCOLS.get(protocol, (None, 0))
fmt = TraceFormatter(mode="reader", decoder=decoder, crc_len=crc_len, is_tty=is_tty)
lines = [fmt.format(0, bytes(command)).lstrip("\n")]
lines = [fmt.format(0, bytes(command)).strip("\n")]
if response:
lines.append(fmt.format(1, bytes(response)).lstrip("\n"))
lines.append(fmt.format(1, bytes(response)).strip("\n"))
return "\n".join(lines)