Skip to content

install.sh: Match font names exactly - #2093

Merged
Finii merged 2 commits into
ryanoasis:masterfrom
Dev-next-gen:install-exact-font-name
Oct 14, 2026
Merged

Finii merged 2 commits into
ryanoasis:masterfrom
Dev-next-gen:install-exact-font-name

Conversation

@Dev-next-gen

Copy link
Copy Markdown
Contributor

Description

./install.sh install UbuntuMono downloads and installs Ubuntu. Same for InconsolataGo (gets Inconsolata) and IosevkaTerm (gets Iosevka). Since 7008d6d nerd_find_spelling uses the requested name as an unanchored regex and returns the first released name that is contained in it, and the shorter name comes first in the asset list. The interactive menu and install all go through the same lookup with exact names, so they are affected too.

The fix compares with a quoted ==. nocasematch is still set, so install ubuntu still resolves to Ubuntu.

I checked it with a dry run against v3.5.1 (GH_RELEASE_TAG=v3.5.1 ./install.sh -d install UbuntuMono, same for InconsolataGo and ubuntu). Before: the "download & install font" line says Ubuntu and Inconsolata. After: UbuntuMono and InconsolataGo, and ubuntu still gives Ubuntu. An unknown name still ends with Can not find font.

Requirements / Checklist

  • Read the Contributing Guidelines
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan.
    Issue number where discussion took place: #xxx
  • If this contains a font/glyph add its origin as background info below (e.g. URL)
  • Verified the license of any newly added font, glyph, or glyph set. License is: xxx

  • I did not use AI/LLM to create this PR, or
  • I disclosed the tool/model below and reviewed its output. I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM. Or
  • I am an AI/LLM agent

What does this Pull Request (PR) do?

Makes install.sh install <name> pick the font with that exact (case insensitive) name instead of the first font whose name is contained in it.

How should this be manually tested?

./install.sh -d install UbuntuMono should download UbuntuMono, not Ubuntu.

Any background context you can provide?

The lookup was introduced in 7008d6d (case insensitive font names). The commit message also discloses the AI use, as contributing.md asks.

What are the relevant tickets (if any)?

None.

Found by a defect-hunting pipeline I build and run (Dev-next-gen), using Claude Code with Anthropic's Claude Opus 5.5.

[why]
Since the case insensitive name lookup the requested name is used as an
unanchored regex against the released font names, and the first name
contained in the request wins. 'install UbuntuMono' downloads Ubuntu,
InconsolataGo gives Inconsolata, IosevkaTerm gives Iosevka. This also
hits the interactive menu and 'install all', because they pass the exact
names through the same lookup.

[how]
Compare with a quoted == instead. nocasematch still makes it case
insensitive.

AI disclosure: this change was written with Claude Code (Claude Opus 5.5).
@Finii

Finii commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR.

For humans...: I think I messed lhs and rhs of the regex operator.
But using the == op is even better, so 👍

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii
Finii merged commit 3c63ac9 into ryanoasis:master Oct 14, 2026
@Finii

Finii commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

@allcontributors please add @Dev-next-gen for code

@allcontributors

Copy link
Copy Markdown
Contributor

@Finii

I've put up a pull request to add @Dev-next-gen! 🎉

@Finii Finii added the Bug fix label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants