Repository navigation
Escape terminal controls in commit subjects and PR context - #4605
Merged
Merged
Conversation
worktrunk-bot
approved these changes
Oct 27, 2026
max-sixty
pushed a commit
that referenced
this pull request
Nov 8, 2026
`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. Co-authored-by: worktrunk-bot <[email protected]>
1 task
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.
Commit subjects and forge metadata could emit terminal commands in styled output, including OSC 52 clipboard sequences. Escape control bytes with the existing helper before truncating or styling the list message and PR/MR context. JSON retains the original subject.
Regression tests reproduce both input paths and verify that application styling remains enabled. Both also passed real 80-column xterm PTY probes. Independent review found no issues.
Local validation: linting, documentation, and doctests passed. The full gate ran 5,443 tests: 5,440 passed and three failed in foreground-process, fish-wrapper, and detached-removal tests outside the changed paths.