Skip to content

fix: fall back to default font when no -f flag is given#3

Open
kdedev wants to merge 1 commit intomarchaesen:mainfrom
kdedev:fix-font-fallback-null
Open

fix: fall back to default font when no -f flag is given#3
kdedev wants to merge 1 commit intomarchaesen:mainfrom
kdedev:fix-font-fallback-null

Conversation

@kdedev
Copy link

@kdedev kdedev commented Feb 10, 2026

When st-wl is launched without the -f flag, opt_font is NULL.
The line usedfont = opt_font passes NULL to wlloadfonts(), which skips
FcNameParse entirely and calls wlloadfont() with a NULL pattern.
This causes can't open font (null) and the terminal fails to start.

Fix: fall back to the static font variable defined at the top of wl.c
when opt_font is not set.

-  usedfont = opt_font;
+  usedfont = opt_font ? opt_font : font;

When st-wl is launched without the -f flag, opt_font is NULL.
The line 'usedfont = opt_font' passes NULL to wlloadfonts(),
which skips FcNameParse entirely and calls wlloadfont() with
a NULL pattern. This causes 'can't open font (null)' and the
terminal fails to start.

Fix: fall back to the static font variable defined at the top
of wl.c when opt_font is not set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant