Skip to content

fix(terminal): render halfwidth katakana voiced marks - #2257

Open
kazunari-kamata wants to merge 1 commit into
herdrdev:masterfrom
kazunari-kamata:fix/halfwidth-katakana-rendering
Open

fix(terminal): render halfwidth katakana voiced marks#2257
kazunari-kamata wants to merge 1 commit into
herdrdev:masterfrom
kazunari-kamata:fix/halfwidth-katakana-rendering

Conversation

@kazunari-kamata

@kazunari-kamata kazunari-kamata commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Fix rendering for halfwidth katakana graphemes that use halfwidth voiced or semi-voiced marks, such as ガギグゲゴ and パピプペポ.

Root Cause

Ghostty reports halfwidth katakana plus U+FF9E/U+FF9F as a wide cell with a spacer tail. Herdr previously normalized the grapheme through unicode-width, which reports these strings as width 1, so the pane renderer could replace them with blanks.

After preserving the grapheme, the ANSI blitter still treated it as width 1 and could draw the tail cell afterward, overwriting the voiced kana on the host terminal.

Changes

  • Preserve halfwidth katakana + halfwidth voiced/semi-voiced mark graphemes when Ghostty reports them as wide cells.
  • Keep Ghostty spacer-tail cells as empty symbols instead of converting them to spaces.
  • Treat these graphemes as width 2 in the terminal ANSI blitter so full and diff redraws skip covered tail cells correctly.
  • Add regression tests for pane rendering, retained dirty patches, and ANSI full/diff redraw behavior.

Docs

No public docs update needed. This is a terminal rendering bug fix and does not change documented commands, configuration, or workflows.

Validation

  • cargo fmt --check
  • cargo test halfwidth_katakana_voiced -- --nocapture
  • cargo test halfwidth_voiced_kana -- --nocapture

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 779b68b8-ab0d-4822-9429-226737b0c797

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 4, 2026
@kazunari-kamata
kazunari-kamata force-pushed the fix/halfwidth-katakana-rendering branch from 5197d15 to a230570 Compare August 4, 2026 01:49
@kazunari-kamata
kazunari-kamata force-pushed the fix/halfwidth-katakana-rendering branch from a230570 to a7b51ab Compare August 4, 2026 01:50
@kazunari-kamata
kazunari-kamata marked this pull request as ready for review August 4, 2026 02:00
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes rendering of halfwidth katakana with voiced and semi-voiced marks across pane extraction and ANSI output.

  • Preserves Ghostty wide-cell graphemes and their empty spacer tails.
  • Treats matching graphemes as two cells during full and differential ANSI redraws.
  • Adds regression coverage for pane rendering, dirty patches, and ANSI redraw behavior.

Confidence Score: 5/5

The PR appears safe to merge, with the pane and ANSI rendering changes consistently handling the wide grapheme head and its covered tail.

The changed extraction and blitting paths agree that halfwidth voiced-kana graphemes occupy two cells, and the regression tests cover full rendering, retained dirty patches, and transitions during differential redraws.

Important Files Changed

Filename Overview
src/pane/terminal.rs Preserves halfwidth voiced-kana graphemes and empty wide-cell tails in full and retained pane rendering, with focused regression tests.
src/protocol/render_ansi.rs Adds specialized two-column accounting so full and differential ANSI redraws do not overwrite wide-kana spacer tails.
src/server/headless.rs Updates frame-comparison test helpers to regard empty and space symbols as equivalent only when covered by a preceding wide cell.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Ghostty wide kana grapheme] --> B[Pane cell extraction]
  B --> C[Preserve grapheme head]
  B --> D[Preserve empty spacer tail]
  C --> E[FrameData]
  D --> E
  E --> F[ANSI blitter]
  F --> G[Treat grapheme as width 2]
  G --> H[Skip covered tail cell]
Loading

Reviews (1): Last reviewed commit: "fix(terminal): render halfwidth katakana..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants