Use more widely-supported Unicode symbols for the commit graph#5573
Open
stefanhaller wants to merge 1 commit intomasterfrom
Open
Use more widely-supported Unicode symbols for the commit graph#5573stefanhaller wants to merge 1 commit intomasterfrom
stefanhaller wants to merge 1 commit intomasterfrom
Conversation
The commit graph used '⏣' (U+23E3 BENZENE RING WITH CIRCLE) for merge commits and '◯' (U+25EF LARGE CIRCLE) for regular commits. Both have very poor coverage in popular monospace fonts: - '⏣' lives in the Misc Technical block and is essentially absent from every common monospace font (Source Code Pro, JetBrains Mono, Fira Code, Cascadia Code, Hack, Iosevka, Menlo, Consolas, Monaco, IBM Plex Mono, Ubuntu Mono, Noto Sans Mono, Inconsolata). It is always drawn from a system fallback font. - '◯' is the late-addition LARGE CIRCLE codepoint. It is present in some fonts (Cascadia, Fira Code, Hack, Iosevka, Menlo, Noto Sans Mono) but missing from many others, including Source Code Pro and most Nerd Font derivatives based on it. This is why the graph renders inconsistently across platforms even when the same monospace font is configured: each OS picks a different fallback font (Apple Symbols on macOS, Segoe UI Symbol on Windows, Noto/DejaVu/Symbola on Linux), and the substituted glyphs differ in shape, weight, and advance width. '◯' is also East Asian Ambiguous width, so some terminals render it wider than one cell, exaggerating the misalignment. Replace the symbols with codepoints from the foundational 1991 Geometric Shapes block, which has far broader font coverage: - Merge: '◎' U+25CE BULLSEYE -- concentric circles, the visually closest cousin to the previous benzene-ring glyph. - Commit: '○' U+25CB WHITE CIRCLE -- the same hollow-circle silhouette as before, just a more universally available codepoint. The new symbols are present in the font directly in significantly more cases; and when fallback is still required, they are universally well-drawn (unlike '⏣', which many fallback fonts also lack). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The commit graph used '⏣' (U+23E3 BENZENE RING WITH CIRCLE) for merge commits and '◯' (U+25EF LARGE CIRCLE) for regular commits. Both have very poor coverage in popular monospace fonts:
This is why the graph renders inconsistently across platforms even when the same monospace font is configured: each OS picks a different fallback font (Apple Symbols on macOS, Segoe UI Symbol on Windows, Noto/DejaVu/Symbola on Linux), and the substituted glyphs differ in shape, weight, and advance width. '◯' is also East Asian Ambiguous width, so some terminals render it wider than one cell, exaggerating the misalignment.
Replace the symbols with codepoints from the foundational 1991 Geometric Shapes block, which has far broader font coverage:
The new symbols are present in the font directly in significantly more cases; and when fallback is still required, they are universally well-drawn (unlike '⏣', which many fallback fonts also lack).
I also considered choosing suitable nerd font symbols for those who are using nerd fonts, on the assumption that these must work better because they are guaranteed to be in the font and no fallback font substitution is necessary; several suitable icons could be considered, e.g.
nf-cod-circle_largeornf-md-circle_double. Surprisingly, these didn't work well, and the reason is that (at least in the font I am using) these are defined with a glyph width that is wider than their advance width, which means they draw in different sizes depending on whether they are followed by a space or not. The glyphs we picked above don't have this problem.And finally, I considered adding config options so that users with weird fonts can pick symbols that work well for them. I would like to avoid having to do this though; ideally we should be able to make a choice that works well for everybody.