Skip to content

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

Merged
ogulcancelik merged 2 commits into
herdrdev:masterfrom
kazunari-kamata:fix/halfwidth-katakana-rendering
Aug 4, 2026
Merged

fix(terminal): render halfwidth katakana voiced marks#2257
ogulcancelik merged 2 commits into
herdrdev:masterfrom
kazunari-kamata:fix/halfwidth-katakana-rendering

Conversation

@kazunari-kamata

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

Copy link
Copy Markdown
Contributor

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: d89aac38-8620-4074-8604-5c9735471251

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

The PR preserves Ghostty’s halfwidth voiced-katakana graphemes and spacer tails through pane rendering, then accounts for their effective two-cell width in ANSI output.

  • Preserves halfwidth katakana followed by voiced or semi-voiced marks when Ghostty marks the grapheme wide.
  • Keeps SpacerTail symbols empty in full and retained pane data.
  • Updates ANSI full and differential redraw width handling.
  • Adds pane, retained-patch, and ANSI regression coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/pane/terminal.rs Preserves halfwidth voiced-katakana graphemes reported as wide and retains empty Ghostty SpacerTail symbols through pane and dirty-patch rendering.
src/protocol/render_ansi.rs Treats the targeted grapheme pair as two cells so full and differential ANSI redraws avoid overwriting its covered tail.
src/server/headless.rs Adjusts frame-comparison test helpers to recognize empty and space tail symbols as equivalent only when covered by a preceding wide cell.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  PTY[PTY bytes] --> Ghostty[Ghostty terminal]
  Ghostty --> Head["Wide kana head: ガ"]
  Ghostty --> Tail["SpacerTail: empty symbol"]
  Head --> Pane[Pane / retained frame]
  Tail --> Pane
  Pane --> ANSI[ANSI blitter]
  ANSI --> Width[Effective width = 2]
  Width --> Host[Host terminal redraw skips covered tail]
Loading

Reviews (2): Last reviewed commit: "Merge branch 'master' into fix/halfwidth..." | Re-trigger Greptile

@ogulcancelik
ogulcancelik merged commit be1891e into herdrdev:master Aug 4, 2026
8 checks passed
@ogulcancelik

Copy link
Copy Markdown
Collaborator

ty!

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.

3 participants