fix(tui): add plain font style fallback#337
Open
kupendrav wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an opt-in “plain font style” mode for the TUI by stripping certain font-variant modifiers (bold/dim/italic/reversed) from the rendered buffer when an environment variable is set.
Changes:
- Introduces
JCODE_TUI_PLAIN_FONT_STYLEenvironment flag parsing. - Post-processes the frame buffer to remove selected
ratatuiModifiers when enabled. - Adds a unit test ensuring symbol contents are preserved while modifiers are stripped.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Fixes #330
Testing:
This does not look like message data corruption. The regression test keeps the exact ASCII text
browser continue Done Builtin the buffer, then removes only terminal font style modifiers. The symbols remain unchanged.That points to a terminal/font rendering problem: some styled glyph variants are missing or rendered as boxes. This patch adds an opt-in fallback:
JCODE_TUI_PLAIN_FONT_STYLE=1
When enabled, the final TUI frame strips bold/dim/italic/reverse modifiers before Ratatui writes the buffer, avoiding bad font variants while preserving text, colors, layout, and transcript data.