Skip to content

fix(powerline): fall back to a plain | separator when no Powerline font is detected - #718

Open
axisrow wants to merge 2 commits into
sirmalloc:mainfrom
axisrow:fix/604-font-safe-separator
Open

axisrow wants to merge 2 commits into
sirmalloc:mainfrom
axisrow:fix/604-font-safe-separator

Conversation

@axisrow

@axisrow axisrow commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

Closes #604 (the separator-fallback half; the theme half is handled by #607).

The default powerline separator is the private-use-area glyph U+E0B0. Without a Powerline/Nerd Font it renders as mojibake, and while checkPowerlineFonts() can detect the absence of fonts, that warning only surfaced in the TUI setup flow — enabling powerline via config/CLI on a machine without fonts produced garbage glyphs in every render. Regular-mode separators suffer the same when users type PUA characters as their separator.

What this does

Render-time font-safe pass, applied to:

  • powerline separators, startCaps, endCaps (renderer's powerline path);
  • regular-mode separator character and defaultSeparator (renderer's regular path).

Mechanics:

  • fontSafeSeparator(): detected-safe text passes through, anything else falls back to a plain |;
  • the detection result is cached per process (setCachedPowerlineFontStatus as a test seam) and respects CCSTATUSLINE_FONT_CHECK=skip.

Regarding the behavior question raised on the issue: this keeps the fallback tied to a local negative scan (the approach this fork has run in production for a while). The scan result is cached, so the decision is made once per process, and CCSTATUSLINE_FONT_CHECK=skip gives a way to trust the local detection is wrong.

Verification

  • Full suite: 3118 pass / 0 fail; lint clean (one ??= modernization in the touched function was required by the current lint rules).
  • The font-safe fallback tests were regenerated for the current renderer (separator-font-fallback.test.ts, 50 renderer/sanity tests pass).

🤖 Generated with Claude Code

…nt is detected

Closes the bug half of sirmalloc#604 (the theme half is handled by sirmalloc#607).

The default powerline separator is the private-use-area glyph U+E0B0.
Without a Powerline/Nerd Font it renders as mojibake, and while
checkPowerlineFonts() can detect the absence of fonts, that warning only
surfaced in the TUI setup flow — enabling powerline via config/CLI on a
machine without fonts produced garbage glyphs in every render. The same
applies to regular-mode separators when users type PUA characters as
their separator.

Render-time font-safe pass, applied to powerline separators, startCaps
and endCaps, regular-mode separator characters and the default
separator: detected-safe text passes through, anything else falls back
to a plain |. The detection result is cached per process
(setCachedPowerlineFontStatus as a test seam) and the cache respects
CCSTATUSLINE_FONT_CHECK=skip. Regenerated the font-safe separator
fallback tests for the current renderer.

Co-Authored-By: Claude Code <noreply@anthropic.com>
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.

Feature: use the built-in color themes in non-powerline mode (+ font-safe separator fallback)

1 participant