Emojis garbling the output of *mu4e-article* buffer

7 views
Skip to first unread message

jman

unread,
Jun 15, 2025, 2:32:10 PMJun 15
to 'jman' via mu-discuss

Hello,

Sometimes I receive an email with an emoji in the Subject line that is causing the *mu4e-headers*
buffer to get garbled.

Here is a (hopefully) reduced sample of such email:
https://paste.sr.ht/~jman/6be37adc8b733fe619edcf9cb818a569b7397061

Two interesting details:
- it only happens with when running `emacs -nw`. Emacs PGTK is just fine. Running Wayland in case
it's relevant
- if I create an email my self and add an emoji with `emoji-insert`, no problem. I only have this
problem with some emails I receive.

I'm not sure where to start diagnosing this issue. Any suggestion?

Thanks

Tassilo Horn

unread,
Jun 16, 2025, 3:25:33 AMJun 16
to 'jman' via mu-discuss
"'jman' via mu-discuss" <mu-di...@googlegroups.com> writes:

> Sometimes I receive an email with an emoji in the Subject line that is
> causing the *mu4e-headers* buffer to get garbled.
>
> Here is a (hopefully) reduced sample of such email:
> https://paste.sr.ht/~jman/6be37adc8b733fe619edcf9cb818a569b7397061
>
> Two interesting details:
> - it only happens with when running `emacs -nw`. Emacs PGTK is just
> fine. Running Wayland in case it's relevant

Indeed, I can reproduce the issue. Here are 2 screenshots, the first
showing the headers buffer in a graphical emacs frame, the second in a
tty frame:
Screenshot-2025-06-16_09-11-53.png
Screenshot-2025-06-16_09-12-20.png

Phillip Susi

unread,
Jun 16, 2025, 3:53:51 PMJun 16
to 'jman' via mu-discuss
"'jman' via mu-discuss" <mu-di...@googlegroups.com> writes:

I investigated this myself several months ago. It turns out that
certain unicode characters like emoji and grapheme clusters are
supposed to be displayed as a double wide character, but different
terminals calculate the width wrongly in different ways. Some think it
is 4 wide, others 5 or 6. I filed a bug in emacs and was told that they
can't fix it because there is no way to find out how wide the terminal
thinks the character is. I keep meaning to find a way to just filter
out the characters so they don't break my terminal.

This article was interesting:

https://mitchellh.com/writing/grapheme-clusters-in-terminals

jman

unread,
Jun 16, 2025, 5:20:46 PMJun 16
to Phillip Susi, 'jman' via mu-discuss
Phillip Susi <ph...@thesusis.net> writes:

> I investigated this myself several months ago. It turns out that
> certain unicode characters like emoji and grapheme clusters are
> supposed to be displayed as a double wide character, but different
> terminals calculate the width wrongly in different ways.
> [...]
Wow thank you so much for the context! I will read the article later but the at the end there's a
table of MODE 2027 support for a number of Linux terminal emulators. I use the Kitty terminal
emulator, which the article says does not support MODE 2027. However, after digging a little bit I
discovered that it was implemented just one month ago (!) in kitty 0.42, which I tested and - yes -
fixes the problem! I'll wait for Debian to release the update :-)

I don't know your setup but maybe you're lucky and there's a terminal emulator you like that
supports grapheme clusters.

Thanks again! Solving this issue was a hilarious combination of asking in the wrong place, finding
by stroke of luck a person with the same problem, pointing me in the right direction and discovering
that the issue was just solved after I've been affected since basically forever (LOL).

Anyway: the internet.
Reply all
Reply to author
Forward
0 new messages