fix(render): handle emoji with variation selectors correctly#223
fix(render): handle emoji with variation selectors correctly#223forketyfork merged 1 commit intomainfrom
Conversation
Issue: Some emoji characters (🌤️🎞️🗣️🖼️🎛️) rendered as empty space in Architect while displaying correctly in Ghostty. These are text-default emoji that require VS16 (U+FE0F) for emoji presentation. Solution: Three compounding problems prevented correct rendering. The renderer only checked for content_tag .codepoint, ignoring cells with .codepoint_grapheme where ghostty-vt stores the variation selector alongside the base codepoint. Grapheme cluster mode (2027) was not enabled, so VS16 never triggered the narrow-to-wide cell promotion that gives these emoji their proper two-cell width. Finally, baseline alignment was skipped for multi-codepoint emoji clusters, causing VS16 emoji to float higher than single-codepoint emoji on the same line.
There was a problem hiding this comment.
Pull request overview
This pull request fixes emoji with variation selectors (specifically VS16/U+FE0F) not rendering in the Architect terminal. The issue was caused by three independent problems that combined to make certain emoji invisible.
Changes:
- Enable grapheme cluster mode in the terminal VT handler to properly handle variation selectors
- Fix renderer to extract codepoints from cells with grapheme data (
.codepoint_graphemetag) - Update font baseline alignment to treat all emoji uniformly regardless of cluster length
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/session/state.zig |
Enables grapheme cluster mode when initializing terminals to handle variation selectors |
src/render/renderer.zig |
Extends codepoint extraction to handle cells with grapheme data |
src/font.zig |
Updates baseline alignment to apply uniformly to all emoji, not just single-codepoint ones |
The changes are well-structured, correctly address the three root causes described in the PR description, and align with the existing codebase patterns. The fix is minimal and focused on the specific issue.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbdad474d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Closes #221
Summary
Text-default emoji that rely on VS16 (U+FE0F) for emoji presentation were invisible in Architect. Three independent problems combined to produce the bug:
.codepoint, so any cell carrying extra grapheme data (.codepoint_grapheme) was treated as codepoint 0 and never rendered.grapheme-width-method = unicode; Architect now does the same.Test plan
printf '🌤️🎞️🗣️🖼️🎛️😊😃\n'in Architect and confirm all emoji render at the same size and vertical alignmentprintf 'e\u0301 n\u0303\n') render correctly