regolith-linux / regolith-st

Suckless simple terminal (st) for Regolith Linux
6 stars 2 forks source link

st crashes when listing directories w/ font glyphs not available in configured font #6

Closed kgilmer closed 4 years ago

kgilmer commented 5 years ago

St will exit in the following code block when trying to list directory contents with glyphs not present in the configured font:

                        if (!frc[frclen].font)
                                die("XftFontOpenPattern failed seeking fallback font: %s\n",
                                        strerror(errno));
kgilmer commented 5 years ago

I can only reproduce this on one computer. I have made the installed font list identical between a working and non-working computer, and so have removed a font installation issue from being able to resolve the problem.

As this issue at present has an unknown root-cause, I'm unsure of a fix at this point.

jc00ke commented 5 years ago

I'm seeing this now too. Screenshot from 2019-09-16 05-39-43

jc00ke commented 5 years ago

I'm pretty sure this is crashing when emoji are not present. I first experienced this when running npm install and again when ls ~/Downloads where I have a file called image where that file is possibly the most awesome tweet reply ever:

Screenshot_2019-05-16 MC HAMMER on Twitter jc00ke 👊

kgilmer commented 5 years ago

Ok, now that someone other than me is seeing this I'll spend more time on it. I want to try a simple fix which is to not destroy the universe in the case that a font cannot be rendered. There is probably a more elegant fix, but this is what I have at the moment. Will keep you posted @jc00ke .

kgilmer commented 5 years ago

Modifying x.c to simply skip characters it cannot find glyphs for seems to prevent the crash, although it does not print anything at all for offending characters so probably not the best fix. Will keep looking into this.

kgilmer commented 5 years ago

There is a related issue mentioned in the ST FAQ: http://git.suckless.org/st/file/FAQ.html line 168.

kgilmer commented 5 years ago

Installing the noto color font fixed the issue for me. @jc00ke can you give this a shot?

sudo apt install fonts-noto-color-emoji
jc00ke commented 5 years ago

image

kgilmer commented 5 years ago

haha, awesome ok I'll add fonts-noto-color-emoji as a dependency of regolith-st.