Repository navigation
Escape terminal control bytes in wt list's Summary column - #4730
Merged
Merged
Conversation
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.
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.
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 throughescape_controlsbefore 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 iscompute_summary_generate→generate_summary_core→execute_llm_command, which only trims the output, thenrender_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_renderinggets 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.