Skip to content

Add a crisp font-rendering option for macOS terminals - #335625

Draft
Anthony Kim (anthonykim1) wants to merge 1 commit into
mainfrom
anthonykim1/terminal-crisp-font-rendering
Draft

Add a crisp font-rendering option for macOS terminals#335625
Anthony Kim (anthonykim1) wants to merge 1 commit into
mainfrom
anthonykim1/terminal-crisp-font-rendering

Conversation

@anthonykim1

Copy link
Copy Markdown
Contributor
  • Add terminal.integrated.fontRendering on macOS with inherit (default) and crisp.
  • Opt into pixel-level antialiasing for high-DPI terminal text without changing the editor, sidebar, theme colors, font family, size, or weight. Other displays continue to inherit the workbench font policy.
  • Apply the terminal style before WebGL initialization and clear cached glyphs after the style changes, so existing text updates without clearing the buffer or reloading the window.
  • Reuse the same helper for normal, detached, and sticky-scroll terminals. Detached updates continue through the existing centralized configuration listener.
  • Add coverage for the unchanged default, initial attachment, live mode changes, cache-refresh ordering, unchanged font/theme options, and detached terminals.

The rendering comparison pointed to font-smoothing policy as the significant appearance difference. This is an opt-in style preference, not a new renderer or an increase in resolution. The separate xterm alpha-blending experiment, texture-filtering changes, native-renderer ideas, and demo color overrides are intentionally outside this PR; no xterm dependency or source changes are required.

Validation

  • GOMAXPROCS=2 npm run transpile-client
  • GOMAXPROCS=2 npm run typecheck-client
  • VSCODE_SKIP_PRELAUNCH=1 ./scripts/test.sh --run vs/workbench/contrib/terminal/test/browser/xterm/xtermTerminal.test — 24 passing.
  • Targeted ESLint for the changed TypeScript files and stylelint for terminalFontRendering.css.

Manual review cases

  1. On a macOS HiDPI display, compare inherit and crisp using the same font and theme in panel/editor terminals. Check that surrounding workbench text and terminal colors do not change.
  2. Toggle the mode with text already visible. The glyph appearance should update without clearing terminal content; sticky-scroll and detached terminal output should follow the same policy.
  3. Check a lower-DPI display or move the terminal between displays: crisp should not force pixel antialiasing below the existing HiDPI threshold.

Inspirations from:

Copilot AI balanced review requested due to automatic review settings September 11, 2026 05:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The platform-gated configuration contract is inaccurate, and detached forwarding is not actually covered by the new test.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Medium severity · 1 Low severity

New issues introduced by this change (2)
Severity Finding
Medium severity src/​vs/​workbench/​contrib/​terminal/​common/​terminal.ts — Model the excluded setting as optional
Low severity src/​vs/​workbench/​contrib/​terminal/​test/​browser/​xterm/​xtermTerminal.test.ts — Exercise detached configuration forwarding
What changed in this PR

Adds an opt-in crisp font-rendering mode for macOS terminals while preserving existing defaults.

Changes:

  • Registers terminal.integrated.fontRendering.
  • Applies smoothing consistently to standard, detached, and sticky-scroll terminals.
  • Refreshes glyph caches and adds targeted tests.
File Description
terminalStickyScrollOverlay.ts Applies rendering policy to sticky scroll.
xtermTerminal.test.ts Tests rendering configuration behavior.
terminalConfiguration.ts Registers the setting.
terminal.ts (workbench) Adds the configuration property.
xtermTerminal.ts Applies rendering during attachment and updates.
terminalFontRendering.ts Implements class updates and atlas refresh.
terminalFontRendering.css Defines HiDPI smoothing behavior.
terminal.ts (platform) Adds the setting identifier.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

drawBoldTextInBrightColors: boolean;
fastScrollSensitivity: number;
fontFamily: string;
fontRendering: 'inherit' | 'crisp';
}, undefined));
attach(terminal);
await setFontRendering('crisp');
terminal.updateConfig();
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.

2 participants