Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
Windows Terminal
The new Windows Terminal and the original Windows console host, all in the same place!
I don't know of a single terminal that actually gets these ZWJ emoji sequences right. There are several terminals who will render them, but I haven't seen any actually get the width calculations correct. (E.g., https://github.com/kovidgoyal/kitty/issues/3810.) Part of the problem is that it really messes up the idea of a rectangular grid of base characters in memory, so you'll need some sort of indirection. Obviously I haven't tested all terminal emulators in existence, though :-)
I patched a similar bug in screen earlier this year (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1039503), which indicates the kind of stuff you have to go through.
https://github.com/xcode-actions/clt-logger/blob/12a5ebc1b00...
Is it windows or is it golang making the difference there? Golang's implementation of wcwidth is different, and a commonly used lib has an 'emoji' table which covers that bomb (1F4A3)
https://github.com/mattn/go-runewidth/blob/master/runewidth_...
The family emoji looks to have the wrong width, but it does resemble the behaviour supposed to be fixed by https://github.com/mattn/go-runewidth/pull/63 (see https://github.com/mattn/go-runewidth/issues/59 - like the flag example, that's multiple emojis with zwnj right?)
I quite like them in GitHub release descriptions, e.g. those by Ghost CMS https://github.com/TryGhost/Ghost/releases/tag/v5.52.0
I'm on the VS Code team and maintain xterm.js which is what Hyper's frontend is based on. There are actually multiple developments happening in this area.
First, there's a contribution from the author of DomTerm which adds grapheme cluster support to xterm.js, which will correctly merge and size things like emoji that are called out in the post. This is currently based on Unicode 15. See https://github.com/xtermjs/xterm.js/pull/4519
Second, while Windows Terminal does seem to work with emoji sometimes, it doesn't all the time. I'm not 100% sure, but I think it may only work on Windows ptys, not in WSL for example. Last time I spoke with the team they said they're working on a rewrite which could lead to proper emoji support.
Related posts
- Contour: Modern and Fast Terminal Emulator
- Linux Terminal Emulators Have the Potential of Being Much Faster
- Windows Terminal-like terminal for Linux?
- How to fix this in Neovim. Im using WSL2 On Windows 11 and im running ubuntu on it. Whenever I type a long line it happens and it also happens randomly too. The text just goes out of the area. HOW TO FIX THIS?
- Alternative to Windows Terminal for Windows Server