cmux-next: agent pane code draws in the terminal's font (cx-ncc.100)
Code in the agent pane now draws in the terminal's font. That covers the inline edit diffs, the changes view, code blocks, and file names and paths. It is the agent pane part of bead cx-ncc.100: #20780 calmed the diff but left it on the default mono stack.
This PR stacks on #20880, which sends the terminal's face with every page theme (WebTheme terminal.fontFamily). This PR merges after #20880 and is web-only once #20880 has landed.
What changes
applyAgentTheme(agent-session/shared/theme.ts) reads the face the shared web theme just applied (window.cmuxTheme.current.terminal.fontFamily; the host applies it right before the pane's own theme on every change,AgentPaneTheme.swiftscriptandpageHost.ts). It sets the pane's two code variables:--cmux-diff-code-font-family, for diffs (diffTheme.tsalready reads it);--cv-code-font, for code blocks, file headers and the changed-files paths.
- The mono stack stays behind the face. Without a named face, both variables clear, and the stylesheet stack applies as before.
- A terminal font change follows in place. No new host params, so there is no pane policy change.
Font size stays 12px on an 18px line. The pane's code is denser than a terminal on purpose. Matching the terminal's size would need the size in WebTheme too; that is not done here.
Testing
test/agent-pane-terminal-font.test.ts(jsdom, no browser) was red on b6f164cb7db0: 3 of 4 failed, because the pane never applied the face. It is green on ebf097c24f8f and later: 4 of 4 pass. Commands:heavy --mem 2G bun test test/agent-pane-terminal-font.test.ts- local only; no PR existed yet when the red commit was pushed.
code-pages-terminal-font.test.ts(#20880) still passes.bun run checkpasses.
Captures
After the merge: a DEV build of the landed commit, with the terminal font set to Courier New in the Ghostty config. The changed-files paths draw in the terminal's face (Courier's serifs) instead of SF Mono, in dark and light:


Changelog
Fixed: Code in the agent pane (diffs, code blocks, file paths) uses your terminal font
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Code in the agent pane now draws in the terminal's font, matching the diff, markdown and editor pages. Previously code always fell back to the stylesheet mono stack; now the terminal's face (cmux.json's terminal.fontFamily, else the Ghostty config's font-family) follows in place on theme changes.
- The host sends the terminal's face with every page theme via
WebTheme.terminal.fontFamily. - The agent pane reads it and sets its code variables: inline edit diffs, the changes view, code blocks, file names and paths.
- Without a named face the mono stack applies; font size stays 12px on an 18px line.