Terminal Support for Emoji
darrenburns.net
darrenburns.net
It’s like the Oxford English Dictionary decided that they’re actually poets; their main job is suddenly to invent brand new words that let people write with an exciting level of density and poetic license; and those new dictionary words would also be multi-color because everybody owns a pack of colored pencils, right.
How do you propose that Unicode include glyph innovations that are digital-first?
How often do people need to do that; with that level of fidelity, right down to the composition of the family? My suspicion is not often. A short sentence does this description just as good and is much less ambiguous, as in written, concise communication that is "emoji-rich" is filled with so many details (such as the composition of the family and their skintone) it's often not clear which details are important for the message and which are not. In addition because emojis are rendered differently on different devices the meaning may be lost (e.g. when apple changed the gun emoji to a watergun, many messages took on different meanings depending on if a revolver was used or a watergun)
so you're now dictating what can be said, rather than designing a system for which _anything_ that could be said is possible?
You're missing the goal of a system of writing and representation.
Surprisingly, this happens. I recently started to use a lot of emojis, including ones like these, to name calendar events - because I use a watch face on my smartwatch that renders the next 12 hours worth of events on the clock face, and given the small space, many of the events can fit three or four letters of description. Emojis work as great workaround, because I can encode things like "takeoff, gate A11" in 4 visual characters, or "doctor's visit" in one.
(I prefix the event titles with emojis rather than replace the longer form completely, because some of those events are shared, and sometimes I forget what an emoji stands for anyway...)
Now, this is perhaps an unique use case, but I found myself doing this in other scenarios too, like task planners - the common thread is, "not enough space to fit full label".
Unicode doesn’t include ligature code points for every English word either. Somehow we manage to keep glyphs and words separate. Why couldn’t we do the same for inline graphics?
The copyright situation around emoji is actually worse now than if they’d been kept out of the standard. People expect emojis to look like on iPhone, but those specific graphics are owned by Apple, leaving everybody else scrambling for emojis that look close enough without infringing.
If emojis had originally been released as an open source library of SVG graphics together with some kind of standard shorthand way to refer to them without embedding an entire inline URL, we could have truly open clip art instead of this weird semi-proprietary mess.
This way, we get an evolving library of emoji, just like how languages evolve. Unicode is stiffling this evolution.
https://en.wikipedia.org/wiki/Line_(software)
If I buy a set of stickers (little animations, much more expressive than emojis) I can send them to anyone in chats, or I can send the set as a gift to that user; in the latter case, the user can add them to their library.
Your library is the standard stickers, any free stickers you've added, anything you've bought, and anything you've been gifted.
The end result is that some people have a fairly distinct sticker-communication style because they have in their library relatively obscure ones, or just like to use the less-popular free ones.
In theory anyone can make their own stickers but it's kind of a pain, and I haven't gotten around to it:
https://creator.line.me/en/stickermaker/
So in my ideal world, we'd not have any emojis that can't be reduced to expressive ASCII, but we'd have a massive public library of freely available SVG Stickers with accessibility features, and all the chat apps would use them.
However, stickers have a culture of their own, and I don’t think it’s inferior to emojis, maybe it’s even better. You can express a lot in a sticker or two, without words, and quickly. And they’re not tiny ambiguous glyphs, they have the room they need.
So far in my Line experience I’m the only one using emojis (I should probably stop) because it seems like the standard is to use text to say specific things and use stickers to convey emotions.
I’m a foreigner and don’t have a million Line friends, but that’s how it looks to me.
Not really. Just Apple users.
Why does Unicode specifically need to include novel "innovations"?
It's arguably failure of the community that we have not been able to standardize interoperable higher level rich text formats, so now everything and kitchen sink needs to be bolted on Unicode instead in the name of interop.
Unicode chose to get into emoji because Japanese carriers were already making their own private character sets with emoji, and Unicode has a goal of being a superset of all other (relevant) character sets. (Arguably emoji support in Unicode has been a resounding success. Look at the world-wide enthusiasm around each new Unicode version that gets announced now!)
Why you need to?
We dealt without hieroglyphs just fine in communication.
With enough optimisation we might just be able to communicate with just a boolean-based language.
(i.e. why limit written communication rather than make it richer)
I think the actual argument here is encoding of seemingly arbitrary colored pictorial combinations overcomplicates character encoding. If you want to display a colored drawing of an arbitrary family SVG is already a thing but if you want to textually encode an arbitrary family you should use characters in your language not expect the text encoding to pick up more arbitrary drawings.
To me, using Emoji was probably a great way to force developer's hands on supporting certain encoding features more complicated languages use even in cases they only wanted to support latin text. That said, this job is already done. We don't need to continue putting everything into ever more complex pictorial encodings via Unicode for the rest of time.
Why or how does the Tahitian language take things too far?
You don't. You use text.
1F468 man
200D zero width joiner
1F469 woman
200D zero width joiner
1F467 girlSee, we invented this thing called the alphabet. You memorize some 20 symbols and combine them to express every possible emotion, instead of memorizing a gazillion symbols.
It’s no wonder hieroglyphs have fallen out of favour in the last 5k years.
Nobody I know or have seen online replaces random words with emoji for brevity. That's annoying. At worst I've seen ironic posts or trying to be hip outlets adding the emoji for a word after the word itself, or use them as bullet point markers.
It reminds me of a thing where it was like, "elephants are so smart because they can use this trumpet to communicate danger", and someone pointed out that humans can do that too by using words. Mind blown.
Using nifty little things called jpegs.
Since the images can be arbitrary you also open yourself up to bugs in the parser.
All around a much, much worse idea compared to text emojis.
You need a "supported editor" to display Unicode emojis too, as TFA shows. And supposedly it is quite hard. OTOH displaying jpegs is a solved problem.
Let's give this a try. This is roughly what a sentence with an emoji looks like in an unsupported editor:
hello [] world
(with [] being the well-known "placeholder" square). Now let's try the same with an emoji, I went with 16x16 to make this kind of bearable, but realistically you'd want at least 64x64:
hello data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAQABADAREAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAIICv/EABwQAAIDAQEBAQAAAAAAAAAAAAQFAgMGBwEIFP/EABoBAAEFAQAAAAAAAAAAAAAAAAACAwUGCAn/xAAhEQACAwEBAAICAwAAAAAAAAADBAECBQYHCBITFAAVFv/aAAwDAQACEQMRAD8A1xbv6+xizYBjaeOtvSMunT5XmVeTDaMAP1waXJyNft7FFlPoub9OHjK5gylJQmBICnfTMgi+6PJ31n5YubHpnY4S5H1eV89d3MumSj0TmCPdLhNmR0dDQNmtpM65HTrHjKxrGlSiY4JdczZL3ppUPljuLz2OdUaRNLYxkt119xdcp1qvKjcXzcyGqFquRYJq1YKGsNMNQSsFqCg6SYX6+xjPYGDZivWjpVnTYcr06vWBtFy/0qbSlPRsMTNtbb6VnPDSJSoYrfYqHIQxsqKIkUUX+nlHyybyPS+OwjkeZ5b0F3DzL5LvQubwsMu44FFB/PNotus45UjtB/tMehoUIpeb1XC0OhJDeWu7XPa5mqJD0cjGd3En011xHZ/RVK4fN04VGKpyMADaoSHiWlmfxRJLAuQf8hP6/wCB/SXGOkaDZ8hzrbo/P9m4cPaglrLqYUMzY1bMHRKs2rm7sSauQJTQgcNqyXkL2CyC+uZwRYNw5E5634bPnnYdjtF8WzPYuM7vo9DrQPL4mrodHyWlpkufUyT2wzhfpi2Nf9hMn1MvWZvFq0Na/wBrpyHYZHoGDgotdn/juj5vJTwzpuuZS+duLJCoBTRWtrhuuV2wxxRoNCCNF5mYggvrML8fcA+kuydHRbPryFxz3BZFumdXAs2PUzB9D4qbrnlCoCrpLwyxrewKVjCmN1q8ZetVTY0wNNKYVD0NeTeF39G7Pjdsfi+Z45xXBdCj1bDh8TUz+i67TziiPl5Qp3DnfJjjMKTtkn8K8zMfWtzVH9V9h2GN59z+8ir2Udl0nSZTeKuok7lsZ+Eu2Ei7WgxbICNcLlRkmq4bXIebxWZgYvvaf//Z world
Now, which one is more readable?
If it was the case, Emoji is seriously lacking a penis. I mean, seriously, give men a way to draw and this is what you will get. There are already existing "subjective combinations" like 8===D and the eggplant emoji for which it is its most common use. There is a proper penis in the hieroglyphics, but just because there is a hieroglyphic doesn't mean there is no corresponding emoji (ex: eye).
On the other hand, many emoji pass even though I have never seen anything remotely similar being scribbled ever, it is the addition to the emoji block that drove its use. Plus, because inclusivity, all its equivalents in different genders, skin tones, cultures, etc...
Clearly, Unicode acts as an arbiter here. It decides on what it thinks it is "good" rather than what is really in use. And it is not just about penises, the hangman is also absent, as is the "gun pointed on head" sign (suggesting suicide) that is commonly used in real life.
Worth noting that the first emoji were included because they were already in common use before Unicode, in Japanese phones specifically. Unicode just included them so that Japanese users could switch to Unicode without loss of functionality.
There is even a "phallus with emission" variant.
𓂺
Not even BabelMap or BabelPad have a font showing more than a square.
𓂲𓂺
Sorry if this doesn't make sense.
So a closer analogy would be the Oxford English Dictionary adding newly-coined words, which—of course—they do https://www.oed.com/discover/the-oed-september-2021-update/ in addition to expanding coverage of older words (analogous to the Unicode Consortium working on historical scripts).
NB if you don't like multi-color emoji, you can also use a monochrome font for them.
Re: monochrome emoji rendering — an impossible proposition if you need to render any user-generated text. People simply can’t understand that their emoji might look different than when they picked it on their iPhone keyboard. The supposed rendering latitude on emojis is completely imaginary; in practice you need to get an emoji set that’s as close as possible to Apple’s without infringing on their design copyrights.
You can, as long as you control the font. Pick any codepoint in the Private Use Area and have your font define a picture for it. That's the whole idea behind icon fonts.
> People simply can’t understand that their emoji might look different than when they picked it on their iPhone keyboard.
Android users who pick an emoji on their Google keyboard and then have something different show up in the message they sent seem to be able to cope somehow.
But if you can't get away from imitating the Apple look because of wrong users, you could still try converting it to monochrome. Maybe users will forgive the deviation if it makes sense in context, e.g. for a terminal emulator.
Granted, that it's supposed to emulate a teletypewriter but I think that ship sailed a long time ago.
Another problem is that some emojis are horribly missing. For example during COVID it would have been nice to have a cotton swab thing.
:face-palm:
Why? It would be next to meaningless now but have to be supported forever. This actually exemplifies why they need to be more strict about what goes in.
The whole emoji phenomenon is a kind of infantilizing cultural rot -- it makes serious, static documentation and tooling resemble a children's book and hinders live communication by encouraging vague single-pictogram messages and the expression of raw emotions (genuine or not) instead of mature and balanced thoughts.
"Single-pictogram messages and expression of raw emotion" are simply not mutually exclusive with mature, well-considered, intentional communication.
Emoji are quite nice for messaging people and occasionally some of the more generic ones can be useful for status indicators (think the red and green circles), but I don't want to be presented with a little green worm every time somebody submits a bug fix on GitHub.
But emojis are great in informal communication when you want to compensate for the fact that your words are completely divorced from inflection, tone, and body language.
Still, the odd facepalm, bug or bomb once in a while doesn't really do any harm.
I use the robot emoji in my ~/.mailmap so I can easily identify bot commits (dependabot, snykbot etc) when scanning through commit logs locally.
Благодаря ти много, добър непознат.
Why such a distinction? Symbols are very useful in commit messages because they can convey a message at a glance that would otherwise require parsing the message. A big, visible symbol for bug fixes and another one for new features makes a lot of sense. Once we’re there, how is it better to use things like Chinese characters rather than emojis?
Making emojis work everywhere also has the very useful side effect that the rest of Unicode works as well. Which is kind of important for the vast majority of the people on earth who need more than ASCII to write in their mother tongue. On balance, it is better that they are supported properly even if you personally dislike them.
Not even considering the moral aspects of wanting to impose on other a way of communicating.
A good commit message doesn't need symbols to tell you what it is doing. (And no, I don't write perfect commit messages.)
> Once we’re there, how is it better to use things like Chinese characters rather than emojis?
Because there are quite a lot of people in this world who speak Chinese but not English, while nobody speaks only emoji.
> On balance, it is better that they are supported properly even if you personally dislike them.
To be clear, I'm not against emoji or Unicode in general. I just dislike the way they seem to be showing up in commit messages and the like as attributes.
And even more people using emojis. Fundamentally, as a native speaker of a European language, there is no meaningful distinction between using fancy image characters and fancy characters that look like symbols. The fact that someone somewhere is using them or not is not very relevant.
> To be clear, I'm not against emoji or Unicode in general. I just dislike the way they seem to be showing up in commit messages and the like as attributes.
Right, but then that’s something you solve by policing the commit messages in your projects. Not by policing how other people you’ll never meet express their ideas or emotions.
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.
In your linked-to article, you suggest 2-em dash and 3-em dash should be 3 and 4 columns respectively. That might be reasonable, but it is explicitly contrary to the EastAsianWidths specification. You also suggest that Pictographics fullowed by text-presentation should have width 1. That seems reasonable, though I don't implement that.
Unfortunately, since a lot of terminals simply use wcwidth, you often have to use that same flawed algorithm in your application to make it work in those terminals.
[1] https://pkg.go.dev/github.com/rivo/uniseg#hdr-Monospace_Widt...
> This issue affects every terminal I've tested: Visual Studio Code, iTerm2, Alacritty, and Hyper.
I don't think those terminals are particularly known for being feature-complete with regards to VT/ANSI codes or new developments such as emoji. The quantity of things a VT-ish terminal must do is massive and not standardized, so many terminals just cover the common cases and nobody notices that they're incomplete.
If the author noted that emojis don't work properly in xterm (not xterm.js) or konsole, then that'd be something to write home about.
For reference, I've written a terminal emulator fairly recently, and found xterm to be most faithful and also a great source of documentation in itself. In personal use though, konsole is pleasant and seems to do everything I've seen right. On the other hand, currently writing this from mac and iterm2 is kind of terrible, send help.
So it was a bit better than the authors tests, but there's still room for improvement.
There seems to be no way to make the cursor clear and visible on all background colours that I used for CLI and text editing. I ended up having to use a difficult-to-see 50% grey cursor, as a compromise that was better than losing the cursor completely sometimes.
It wouldn't send Control-Space or Control-@ from the keyboard (they are the same character, ^@ aka NUL), which is the key used to set the editing mark in Emacs so used a lot. No key combination is mapped to that character in Windows Terminal, and I couldn't find a way to customise it to do so either. Historical real terminals like the VT100, and of course xterm etc, always did so, which is why it's an essential key in some terminal applications. I compromised by binding Control-] to set-mark-command in Emacs but this was annoying when switching between devices.
Finally, line drawing characters, boxes, progress bar characters and such had ugly gaps, as though line height was incorrect for them.
All of these seem to work fine in every other terminal emulator I've used.
[0] https://eev.ee/blog/2015/09/12/dark-corners-of-unicode/#comb...
but yes to be fair, the width on those ridiculous 5 codepoint emoji is off.
It doesn't immediately overwrite the emoji with the next character, but the cursor position is off, which leads to wrapping problems down the line.
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 zwj right?)
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.
This testing was done earlier this year when I was building support for Unicode variable names into my $SHELL (more to support foreign languages than glyphs but the end result is the same)
It’s worth noting that wider character support needs to be implemented in both the terminal emulator AND and the console applications that run on the terminal emulator too.
https://gitlab.freedesktop.org/terminal-wg/specifications/-/...
It is useful to be able to see them on database dumps, to be able to clean them with sed, etc. But it should be a toggle, IMO.