Skip to content

TerminalFont: add bitty support - #2660

Open
Xuepoo wants to merge 1 commit into
fastfetch-cli:devfrom
Xuepoo:terminalfont-bitty
Open

Xuepoo wants to merge 1 commit into
fastfetch-cli:devfrom
Xuepoo:terminalfont-bitty

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 19, 2026

Copy link
Copy Markdown

Bitty (https://github.com/bitty-terminal/bitty) sets TERM_PROGRAM=bitty and implements the kitty font-query protocol, but detectTerminalFontCommon has no bitty branch, so TerminalFont reports Unknown terminal: bitty.

Changes

  • Extract the existing kitty DCS query/reply decode into queryKittyFont() (behavior unchanged for kitty).
  • Add detectBitty():
    • reuses queryKittyFont() for the ESC P +q kitty-query-font_family;... ST query, which bitty answers directly on the PTY;
    • falls back to bitty +show-font and parses its stable font_family: / font_size: lines when the DCS response is swallowed (multiplexer/PTY wrapper) or on Windows.
  • Route processName == "bitty" to detectBitty().

The kitty fallback chain (+kitten query-terminal, then kitty.conf) is unchanged.

Protocol

Request (bitty and kitty):

ESC P +q <hex(font_family)>;<hex(font_size)> ST

Reply (one per key, family first):

ESC P 1+r kitty-query-font_family=<hex(JetBrainsMono Nerd Font)> ST
ESC P 1+r kitty-query-font_size=<hex(12)> ST

Bitty implementation tracking issue: bitty-terminal/bitty#2263.

bitty +show-font output:

font_family: JetBrainsMono Nerd Font
font_size: 12
font_fallback: <optional>

Testing

  • cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j — builds clean on Linux.
  • ./build/fastfetch --structure terminalfont — no regression on the existing detection path.
  • Bitty side is covered by exact-bytes parser/runtime tests plus a real-PTY write-once test.

Happy to adjust naming, fallback ordering, or the extraction shape to match project conventions.

This branch has not been deployed

No deployments
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