Skip to content

Comments

fix(render): handle emoji with variation selectors correctly#223

Merged
forketyfork merged 1 commit intomainfrom
fix/emoji-vs16-rendering
Feb 19, 2026
Merged

fix(render): handle emoji with variation selectors correctly#223
forketyfork merged 1 commit intomainfrom
fix/emoji-vs16-rendering

Conversation

@forketyfork
Copy link
Owner

@forketyfork forketyfork commented Feb 19, 2026

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:

  1. Renderer skipped grapheme cells -- the content tag check only matched .codepoint, so any cell carrying extra grapheme data (.codepoint_grapheme) was treated as codepoint 0 and never rendered.
  2. Grapheme cluster mode was off -- without mode 2027, ghostty-vt handled VS16 as a zero-width attachment instead of promoting the cell from narrow to wide. Ghostty itself enables this mode by default via grapheme-width-method = unicode; Architect now does the same.
  3. Baseline alignment skipped multi-codepoint clusters -- single-codepoint emoji got baseline-aligned while VS16 emoji (two codepoints) were vertically centered, causing a visible height mismatch on the same line.

Test plan

  • Run printf '🌤️🎞️🗣️🖼️🎛️😊😃\n' in Architect and confirm all emoji render at the same size and vertical alignment
  • Verify regular emoji (😊😃👍🔥) still render correctly
  • Verify combining characters (e.g. printf 'e\u0301 n\u0303\n') render correctly

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.
@forketyfork forketyfork requested a review from Copilot February 19, 2026 12:56
@forketyfork forketyfork marked this pull request as ready for review February 19, 2026 12:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_grapheme tag)
  • 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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@forketyfork forketyfork merged commit 591a0ba into main Feb 19, 2026
10 checks passed
@forketyfork forketyfork deleted the fix/emoji-vs16-rendering branch February 19, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Some emoji characters render as empty space in Architect terminal

1 participant