Skip to content

macOS: support decoding the surrogate pair with UnicodeHexInput - #13737

Merged
mitchellh merged 1 commit into
ghostty-org:mainfrom
bo2themax:push-bbe244e9
Aug 11, 2026
Merged

mitchellh merged 1 commit into
ghostty-org:mainfrom
bo2themax:push-bbe244e9

Conversation

@bo2themax

@bo2themax bo2themax commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Not yet a perfect fix for #13733

@bo2themax
bo2themax requested a review from a team as a code owner August 10, 2026 20:58
@ghostty-bot ghostty-bot Bot added the os/macos label Aug 10, 2026
@bo2themax
bo2themax requested a review from jparise August 10, 2026 20:58
@mitchellh

Copy link
Copy Markdown
Contributor

Yeah this is super weird. Ghostty understands raw UTF-8, can these not be UTF-8 encoded and let Ghostty decode the bytes?

@bo2themax

Copy link
Copy Markdown
Member Author

Yeah this is super weird. Ghostty understands raw UTF-8, can these not be UTF-8 encoded and let Ghostty decode the bytes?

I tried this as well, decoding surrogates correctly and send them to the surface, but no🤔. Might give Claude a go today.

@bo2themax

Copy link
Copy Markdown
Member Author

Yeah this is super weird. Ghostty understands raw UTF-8, can these not be UTF-8 encoded and let Ghostty decode the bytes?

So I checked(with Claude), our UTF-8 handling in the lib doesn't cover this, given the fact that AppKit deliver them separately. Since a lone surrogate can't be represented in standard UTF8, we still need some extra handling in either apprt or lib to join them.

For now I think only change swift makes sense. If in the future we support windows upstream and run into the same issue there, we can move it to the lib then.

I also tried with that approach locally, it adds more complexity.

@mitchellh
mitchellh merged commit b0b9fbc into ghostty-org:main Aug 11, 2026
101 checks passed
@github-actions github-actions Bot added this to the 1.4.0 milestone Aug 11, 2026
@bo2themax
bo2themax deleted the push-bbe244e9 branch August 11, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants