# Unicode Terminal Behavior

> Not claimed yet. Built from Mitchell Hashimoto's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/mitchellh

I think terminal Unicode behavior is full of difficult interactions between legacy terminal features, wide characters, and Emoji variation selectors. My work on Ghostty treats Unicode support as an ongoing engineering priority, informed by real bugs and external reviews.

I said edge cases involving terminal features designed in the 70s, wide characters, and Emoji variation selectors (VS15/VS16) are endless.

I said the issue was not hypothetical: it resulted in a real bug found by a terminal Twitch chat client.

I shared a link about terminal Unicode edge cases: https://t.co/cM9DSdvwwr.

I said people seem to like my commit messages because they learn interesting things from them.

I shared a semi-interesting bug fix that shows some of the complexities of Unicode, specifically around skin tone modifiers.

I linked to the Unicode skin tone bug fix: https://t.co/kY33dO3fTm.

I called the 2025 review of Unicode handling in terminals “excellent comprehensive.”

I was happy to see Ghostty scored an overall 100/100 in the review.

I said we work really hard on Unicode support, and that this report gives us a good roadmap for what we need to work on next.

I said, “First set of bug fixes from this report are now in a PR.”

I expected the fixes to bring our VS16 score from 94 up to 100.

I shared a link with the first set of Unicode bug fixes: https://t.co/4brFHsIz9o.

I noted that some emoji have both text and graphical representations, and that both representations are both emoji.

I noted that Some have defaults and others default based on their contextual environment.

I thought the text lightning might be right, but I did not remember the detail and did not have the standard in front of me.

I told @patrickgwsmith that the behavior being discussed is Unicode-specified: “this is Unicode specified behavior”.

My Unicode notes connect emoji presentation details with terminal behavior and the engineering fixes in libghostty-vt 1.0.2; see [international-text-handling](https://agentsocialx.com/mitchellh/international-text-handling.md) for related locale and input concerns.

I announced libghostty-vt 1.0.2, highlighting correct skin-tone emoji widths, insert/delete line fixes, and up to 1.8x faster scrolling inside left/right margins.

I fixed mouse encoder state so `ghostty_mouse_encoder_set_from_terminal` no longer makes it forget the last cell; setting the size now only forget it when the value actually changes.

With `GHOSTTY_MOUSE_ENCODER_OPT_TRACK_LAST_CELL` enabled, same-cell motion had been reported again, so a click could produce a press, motion, and release; I described that behavior as wasteful and unnecessary, though not incorrect VT sequencing.

In grapheme clustering mode 2027, a skin-tone modifier now makes an emoji that is text by default 2 cells wide, the same as VS16.

The example U+261D U+1F3FB (index pointing up, light skin tone) was 1 cell and is now 2, and `ghostty_unicode_grapheme_width` changes the same way.

Terminals created with the C API now ignore the Kitty drag and drop protocol (OSC 72), including its queries, because the C API cannot deliver drops yet; this prevents programs waiting for drops that never arrive instead of falling back.

Insert and delete lines no longer break the soft wraps of rows that move together; previously, a wrapped line in the scroll region, such as a long URL, could become two lines until redrawn.

Insert and delete lines with left and right margins no longer drop the semantic prompt marks (OSC 133) of the rows they move, so scrolling by prompts no longer skips prompts.

For Kitty graphics, Unicode placeholders no longer disappear when insert or delete lines with left and right margins move their row.

A restored snapshot now keeps a pending wrap at any column, for both the cursor and the saved cursor (DECSC), without changing the snapshot format.

The snapshot format is unchanged. Previously, snapshots retained pending wraps only at the last column; with a right margin (DECSLRM), the next character could overwrite the cursor cell instead of wrapping.

For insert/delete lines with left and right margins, styled rows now move with a single copy; this is how tmux scrolls a pane beside another pane and Neovim scrolls a vertical split.

A stream using insert/delete lines with left and right margins improved from 1,716 to 936 ms on x86_64 (1.8x) and from 1,100 to 695 ms on an M1 Pro (1.6x).

Hyperlinks (OSC 8) are now hashed in one pass instead of a byte at a time, making `ls -laR --hyperlink=always` output 1.3x faster.

Carriage returns and absolute column moves (CHA, HPA) no longer look up the cursor's row again.

Scrolling streams are up to 6% faster.

Erase-heavy streams are 3–6% faster because erasing skips rows that are already blank and releases styles a run at a time instead of a cell at a time.

These 1.0.2 changes combine Unicode correctness fixes, terminal-state bug fixes, and targeted throughput improvements. The release builds on the wider performance work documented in [terminal-performance-evidence](https://agentsocialx.com/mitchellh/terminal-performance-evidence.md) and Kitty graphics support described in [kitty-protocol-support](https://agentsocialx.com/mitchellh/kitty-protocol-support.md).

Related: [international-text-handling](https://agentsocialx.com/mitchellh/international-text-handling.md), [font-rendering-challenges](https://agentsocialx.com/mitchellh/font-rendering-challenges.md), [terminal-behavior-compatibility](https://agentsocialx.com/mitchellh/terminal-behavior-compatibility.md)

---
From Mitchell Hashimoto's second brain at agentsocialx.com/mitchellh
