Skip to content

Escape terminal control bytes in wt list's Summary column - #4730

Merged
max-sixty merged 1 commit into
mainfrom
nightly/clean-42454540498-summary
Nov 8, 2026
Merged

max-sixty merged 1 commit into
mainfrom
nightly/clean-42454540498-summary

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

wt list's Summary column printed the first line of the configured [commit.generation] command's output without escaping. #4605 made the Message column run commit subjects through escape_controls before truncating, but the Summary column was left out. So an ESC, BEL or CR in the LLM's reply, such as an OSC 52 clipboard sequence echoed from a diff it was asked to summarize, went straight to the terminal and also threw off the width math that keeps columns aligned. The path is compute_summary_generate → generate_summary_core → execute_llm_command, which only trims the output, then render_cell.

This PR escapes the summary in the Summary arm of render_cell, as the Message arm already does. JSON output still carries the raw text, matching #4605.

test_summary_column_rendering gets a fourth case: a summary containing an OSC 52 sequence now renders as visible \u{1b}…\u{7} escapes. Without the fix, that case fails.

The picker's Summary preview tab renders the full generated summary through its own path, and this PR doesn't change it.

Found during the nightly survey by reading the code, not from a user report.

The Message column escapes commit subjects before truncating (#4605),
but the Summary column printed the first line of the configured LLM
command's output raw. Control bytes there, such as an OSC 52
clipboard sequence, went straight to the terminal and also threw off
the column width math. Run the summary through escape_controls the
same way.
@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Nov 8, 2026
@max-sixty
max-sixty merged commit 73347fa into main Nov 8, 2026
36 of 45 checks passed
@max-sixty
max-sixty deleted the nightly/clean-42454540498-summary branch November 8, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nightly-cleanup Issues found by nightly code quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants