The Context: Does this sound familiar?
I was working as usual when, after executing black src
, my terminal just
vanished. There was no apparent reason for this. However, since I use tmux,
everything was still intact. I opened a new st
terminal, but it was impossible
to attach the tmux session without causing a crash in st
. The culprit?
Emojis!
Note: For more information, check out this video.
More evidence:
The problem
I’m not sure how other terminals handle this, but st
uses libxft
for
rendering emojis (and possibly other characters or even all?). It seems there’s
an issue with this dependency, which is causing this annoying problem.
The solution is to use a more recent version of the library, specifically a version higher than 2.3.4, which is known to have this issue. Once I realized this was the root of the problem, I found a PPA for Ubuntu that has libxft-2.3.6. After installing it, everything worked perfectly!
I should mention that emojis were the most common cause of errors, but I’ve also encountered issues with other characters/symbols that can be easily typed on your keyboard without you even realizing it.
The fix
The fix primarily involves upgrading libxft. I know of two ways to achieve this: one is to compile it yourself, and the other is to use this PPA. I will go with the latter:"
|
|
Now check it out, open a new st
instance and get a list of emojis from the
gist:
|
|
and there you go!
The emojis rendering is not perfect but the main goal is to avoid those unexpected crashes and switches between terminals to keep working.