Repository navigation
Normalise control characters in a border title like TextElement text [patch] - #250
Merged
Merged
Conversation
…[patch] BorderElement.GetSingleLineTitle replaced only line breaks, so a tab or any other C0/C1 control character in Title reached the console provider raw. Spectre drew a replacement glyph for a tab, any other provider received the raw bytes (the terminal-escape path #159 closed for TextElement), and the measured title width disagreed with what was drawn. The title now goes through TextElement.NormalizeControlCharacters after the line-break replacement, so tabs expand to spaces, other control characters become the placeholder, and drawing and measuring use the same string. Fixes #222 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW2U95Ey8C2h9t4Ljwn
…rol-chars-222 # Conflicts: # TUI.Test/BorderElementRenderTests.cs
|
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.



Summary
BorderElement.GetSingleLineTitle()replaced only line breaks. A tab or any other C0/C1 control character inTitletherefore reachedIConsoleProvider.WriteAtraw. Spectre drew a replacement glyph for a tab, any other provider got the raw bytes (the same terminal-escape path #159 closed forTextElement), and the measured title width didn't match what was drawn.The title now goes through
TextElement.NormalizeControlCharactersafter the line breaks are replaced, so:TextElementU+FFFDTests
TitleControlCharactersAreNormalisedLikeTextElement(tab, ESC sequence, BEL + C1 CSI). It checks that no write carries a control character, that the drawn title is the normalised text, and that the measured width matches. It fails onmain(3/3 cases) and passes with the fix.Fixes #222
Generated by Claude Code