Skip to content

feat(terminal): allow themes to set the terminal font family #3236

Description

@smsunarto

The workflow

I was trying to make bb Monokai use my installed BerkeleyMono Nerd Font Mono in the integrated terminal. The palette sets terminal colors, but it cannot supply the font family to the terminal renderer.

What happens today

Source inspection on main at 06aeaa994942ae7527dc49d2268c1f801e8542a0 confirms that ThreadTerminalView passes a fixed font stack to xterm. Live visual reproduction is unverified. The local CLI reports bb 0.42.1 on macOS 26.5.2.

Why

TERMINAL_FONT_FAMILY starts with:

'"JetBrainsMono Nerd Font Mono", "MesloLGS NF", "Symbols Nerd Font Mono", ...'

Terminal construction uses fontFamily: TERMINAL_FONT_FAMILY. BB also loads the optional WebGL renderer, so overriding .xterm-rows with CSS does not configure that renderer's font. The theme-change effect updates terminal.options.theme only.

What you would expect

Proposal

We should let palettes supply a terminal font-family token, for example:

--terminal-font-family: "BerkeleyMono Nerd Font Mono", "Berkeley Mono", monospace;

Read it into xterm's fontFamily at construction and when the active theme changes. Preserve the current default stack when the token is absent, and refit the terminal after a font change so cell dimensions and PTY sizing stay aligned. It should work with WebGL and the fallback renderer.

Context and alternatives

Related: #2197 covers independent interface, chat, and code font settings. This request concerns the integrated terminal and palette control of its renderer.

The installed font's name table confirms BerkeleyMono Nerd Font Mono, matching Monokai's existing CSS override. Changing that CSS family name alone would not change the constructor option above.

Checks

  • I searched open and closed issues for the same request, including terminal font, xterm font, Berkeley, Monokai, and font-family searches.
  • If an agent wrote this, the body ends with > AGENT GENERATED.

AGENT GENERATED

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    uiApp shell, sidebar, composer, rendering

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions