Skip to content

feat(terminal): add font smoothing setting (default / antialiased / subpixel) - #13056

Closed
adaex wants to merge 3 commits into
stablyai:mainfrom
adaex:feat/terminal-font-smoothing
Closed

adaex wants to merge 3 commits into
stablyai:mainfrom
adaex:feat/terminal-font-smoothing

Conversation

@adaex

@adaex adaex commented Aug 7, 2026

Copy link
Copy Markdown

Summary

Adds a terminalFontSmoothing setting (default / antialiased / subpixel) under Terminal → Rendering, so users can opt the terminal into macOS subpixel smoothing. The default preserves today's behavior — existing users see no change.

English 中文

Motivation

body in main.css sets -webkit-font-smoothing: antialiased (grayscale) app-wide, and it inherits into the terminal, whose WebGL atlas bakes it into thinner, lighter glyphs. VS Code renders its terminal with macOS subpixel smoothing — workbench.fontAliasing defaults to a state that adds no aliasing class, so it keeps the browser-native -webkit-font-smoothing: auto (subpixel), Retina included. On light terminal themes Orca therefore reads a touch lighter/blurrier than VS Code.

Rather than force subpixel on everyone (it's a subjective, display-dependent trade-off — great for dark-on-light, less so for light-on-dark), this exposes it as an opt-in.

Options

  • default (default): inherit the app-wide antialiased smoothing — identical to current behavior.
  • antialiased: pin grayscale explicitly.
  • subpixel: -webkit-font-smoothing: auto, closer to VS Code on light themes.

Implementation

CSS-only, mirroring the existing terminalGpuAcceleration setting:

  • App.tsx publishes the value as a data-terminal-font-smoothing attribute on :root (next to the existing --app-font-family effect).
  • terminal.css keys .xterm glyph smoothing off :root[data-terminal-font-smoothing='…'] attribute selectors. default emits no rule, so inheritance is untouched.
  • Setting UI lives under Terminal → Rendering with a matching search entry.
  • No pane-manager / renderer plumbing is touched.

Copy is localized in all shipped languages (en / zh / ja / ko / es).

Note on screenshots: the visible effect of subpixel vs. grayscale is subtle and display-dependent (it hinges on the physical monitor's subpixel layout), so a static screenshot of the terminal itself doesn't convey it reliably. The UI screenshots above show the setting; the rendering change is verified programmatically below.

Testing

  • Verified live via CDP: switching the setting flips getComputedStyle('.xterm')['-webkit-font-smoothing'] between auto (subpixel), antialiased, and inherited (default), and updates the :root attribute accordingly.
  • pnpm typecheck: clean
  • vitest (constants / settings / codex-accounts / terminal): 1244 passed
  • Localization gates pass: verify:localization-extraction, -catalog, -coverage.

@adaex
adaex requested a review from brennanb2025 as a code owner August 7, 2026 16:43
Copilot AI lite review requested due to automatic review settings August 7, 2026 16:43
@AmethystLiang
AmethystLiang requested a review from OrcaWin August 7, 2026 16:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new terminal rendering preference that lets users choose how xterm glyph smoothing is applied (inherit app default / force grayscale / opt into subpixel on macOS), implemented via a root data-* attribute and CSS selectors.

Changes:

  • Introduces terminalFontSmoothing: 'default' | 'antialiased' | 'subpixel' in shared settings types + default settings, with a small default-setting test.
  • Adds a Terminal → Rendering segmented control and corresponding settings-search catalog entry.
  • Implements the behavior purely in CSS (terminal.css) driven by a :root data attribute published from App.tsx, and updates localization strings.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/shared/types.ts Adds the terminalFontSmoothing setting type and inline documentation.
src/shared/constants.ts Sets the default terminalFontSmoothing: 'default' in getDefaultSettings().
src/shared/constants.test.ts Asserts the new setting’s default value.
src/renderer/src/components/settings/TerminalRenderingSection.tsx Adds the UI control for choosing font smoothing under Terminal → Rendering.
src/renderer/src/components/settings/terminal-typography-search.ts Adds a settings-search entry for “Font Smoothing”.
src/renderer/src/assets/terminal.css Applies smoothing rules to .xterm based on :root[data-terminal-font-smoothing=…].
src/renderer/src/App.tsx Publishes data-terminal-font-smoothing on documentElement from settings.
src/renderer/src/i18n/locales/en.json Adds English strings for the new setting + search entry.
src/renderer/src/i18n/locales/zh.json Adds Chinese strings for the new setting + search entry.
src/renderer/src/i18n/locales/ko.json Adds Korean strings for the new setting + search entry.
src/renderer/src/i18n/locales/ja.json Adds Japanese strings for the new setting + search entry.
src/renderer/src/i18n/locales/es.json Adds Spanish strings for the new setting + search entry.
src/main/codex-accounts/service.test.ts Updates test settings fixture to include terminalFontSmoothing.
src/main/codex-accounts/runtime-home-service.test.ts Updates test settings fixture to include terminalFontSmoothing.
Suppressed comments (4)

src/renderer/src/i18n/locales/zh.json:9026

  • This localized search description mixes English option names ("Subpixel" / "Default") into Chinese UI copy, even though the option labels are translated. Please localize those terms for consistency and readability.
            "b2c3d4e5f6": "终端字形的抗锯齿方式。Subpixel 在亮色主题下与 VS Code 一致;Default 继承应用全局的灰度平滑。",

src/renderer/src/i18n/locales/ko.json:9014

  • This localized search description mixes English option names ("Subpixel" / "Default") into Korean UI copy, even though the option labels are translated. Please localize those terms for consistency and readability.
            "b2c3d4e5f6": "터미널 글리프의 앤티앨리어싱. Subpixel은 밝은 테마에서 VS Code와 일치합니다. Default는 앱 전체의 그레이스케일 스무딩을 상속합니다.",

src/renderer/src/i18n/locales/ja.json:9051

  • This localized search description mixes English option names ("Subpixel" / "Default") into Japanese UI copy, even though the option labels are translated. Please localize those terms for consistency and readability.
            "b2c3d4e5f6": "ターミナルグリフのアンチエイリアス。Subpixel はライトテーマで VS Code と一致します。Default はアプリ全体のグレースケールスムージングを継承します。",

src/renderer/src/i18n/locales/es.json:9029

  • This localized search description mixes English option names ("Subpixel" / "Default") into Spanish UI copy, even though the option labels are translated. Please localize those terms for consistency and readability.
            "b2c3d4e5f6": "Suavizado de los glifos del terminal. Subpixel coincide con VS Code en temas claros; Default hereda el suavizado en escala de grises de toda la app.",

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/renderer/src/i18n/locales/zh.json Outdated
},
"a1b2c3d4e5": "字体平滑",
"c3d4e5f6a7": "字体平滑",
"b2c3d4e5f6": "终端字形的抗锯齿方式。Subpixel 在亮色主题下与 VS Code 一致;Default 继承应用全局的灰度平滑。",
Comment thread src/renderer/src/i18n/locales/ko.json Outdated
},
"a1b2c3d4e5": "글꼴 스무딩",
"c3d4e5f6a7": "글꼴 스무딩",
"b2c3d4e5f6": "터미널 글리프의 앤티앨리어싱. Subpixel은 밝은 테마에서 VS Code와 일치합니다. Default는 앱 전체의 그레이스케일 스무딩을 상속합니다.",
Comment thread src/renderer/src/i18n/locales/ja.json Outdated
},
"a1b2c3d4e5": "フォントスムージング",
"c3d4e5f6a7": "フォントスムージング",
"b2c3d4e5f6": "ターミナルグリフのアンチエイリアス。Subpixel はライトテーマで VS Code と一致します。Default はアプリ全体のグレースケールスムージングを継承します。",
Comment thread src/renderer/src/i18n/locales/es.json Outdated
},
"a1b2c3d4e5": "Suavizado de fuente",
"c3d4e5f6a7": "Suavizado de fuente",
"b2c3d4e5f6": "Suavizado de los glifos del terminal. Subpixel coincide con VS Code en temas claros; Default hereda el suavizado en escala de grises de toda la app.",
@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 537fa6f2-75a3-40a2-8436-e9864d43b73b

📥 Commits

Reviewing files that changed from the base of the PR and between 34f2a62 and 70abfa2.

📒 Files selected for processing (14)
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/assets/terminal.css
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/components/settings/terminal-typography-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/shared/types.ts
🚧 Files skipped from review as they are similar to previous changes (14)
  • src/main/codex-accounts/service.test.ts
  • src/renderer/src/components/settings/terminal-typography-search.ts
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/assets/terminal.css
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/App.tsx
  • src/shared/types.ts
  • src/renderer/src/i18n/locales/es.json
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/shared/constants.test.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ko.json
  • src/shared/constants.ts
  • src/renderer/src/i18n/locales/ja.json

📝 Walkthrough

Walkthrough

Adds a terminalFontSmoothing setting with default, antialiased, and subpixel modes. Adds default initialization and test fixture values. Adds a searchable settings control with localized text and persistence. Synchronizes the selected mode to the document root and applies terminal-specific CSS rules.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change, screenshots, and testing, but it omits the required AI Review Report, Security Audit, Notes, and checklist items. Add the required AI Review Report, Security Audit, and Notes sections, and complete or explicitly address all testing checklist items.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the new terminal font smoothing setting and its three supported modes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c98655d6-4c94-43fd-aee7-047657ac8827

📥 Commits

Reviewing files that changed from the base of the PR and between 02a1251 and 7ae2e4868cbf0574c5021f7c345b9eaccce5ce47.

📒 Files selected for processing (14)
  • src/main/codex-accounts/runtime-home-service.test.ts
  • src/main/codex-accounts/service.test.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/assets/terminal.css
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/components/settings/terminal-typography-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/constants.test.ts
  • src/shared/constants.ts
  • src/shared/types.ts

Comment thread src/renderer/src/i18n/locales/en.json Resolved
Comment thread src/renderer/src/i18n/locales/es.json Resolved
Comment thread src/renderer/src/i18n/locales/ja.json Resolved
@adaex
adaex force-pushed the feat/terminal-font-smoothing branch from 9156cb0 to 570e732 Compare August 8, 2026 10:55
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

adaex added 3 commits August 9, 2026 18:51
…ubpixel)

Orca's `body` sets `-webkit-font-smoothing: antialiased` (grayscale)
app-wide, and it inherits into the terminal, whose WebGL atlas bakes it
into thinner, lighter glyphs. VS Code renders its terminal with macOS
subpixel smoothing (workbench.fontAliasing defaults to a state that keeps
the browser-native `-webkit-font-smoothing: auto`), so on light terminal
themes Orca reads a touch lighter/blurrier than VS Code.

Add a `terminalFontSmoothing` setting so users can opt into subpixel
rendering:

- 'default' (default): inherit the app-wide antialiased smoothing —
  identical to today's behavior, existing users see no change.
- 'antialiased': pin grayscale explicitly.
- 'subpixel': `-webkit-font-smoothing: auto`, closer to VS Code on light
  themes.

Implemented as a CSS-only toggle, mirroring the existing
`terminalGpuAcceleration` setting: App.tsx publishes the value as a
`data-terminal-font-smoothing` attribute on `:root`, and terminal.css
keys `.xterm` glyph smoothing off attribute selectors. No pane-manager
or renderer plumbing is touched. Setting lives under Terminal → Rendering
with a matching search entry.
Address CodeRabbit review on stablyai#13056: the Font Smoothing entries used
hand-written sequential hex keys (a1b2c3d4e5…) instead of the repo's
sha1(filePath:text) derived keys, and duplicated identical source text
under separate keys.

- Regenerate all Font Smoothing keys with the standard derivation so they
  match tool-generated output (TerminalRenderingSection.tsx +
  terminal-typography-search.ts).
- Merge the duplicated "Font Smoothing" title/label/aria-label onto one
  key, matching the existing GPU Acceleration convention.
- Reuse the existing 'font' search keyword key instead of minting a new one.
- Localize "Subpixel"/"Default" in the zh/ja/ko/es descriptions
  (Copilot review) so translated copy no longer mixes English option names.

Verified: verify:localization-catalog, verify:localization-extraction,
localization-coverage, typecheck, constants.test all pass.
Address CodeRabbit review on stablyai#13056:
- Describe subpixel as browser-native rather than macOS-only, since the
  setting toggles -webkit-font-smoothing:auto (browser/OS decides), not a
  macOS-gated mode.
- Soften "matches VS Code" to "closer to VS Code" across the option,
  section, and search descriptions in all five locales, matching the
  code comment's own phrasing.
- Keep source fallbacks and locale catalogs in sync (no new extraction drift).

Verified: localization-catalog / extraction / coverage / typecheck pass.
@adaex
adaex force-pushed the feat/terminal-font-smoothing branch from 570e732 to 70abfa2 Compare August 9, 2026 10:54
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@nwparker

nwparker commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #36577: every editor surface now shares one typography setup, with opt-in font size, weight, line height, ligatures and macOS smoothing. Thank you for this PR, it shaped the design.

@nwparker nwparker closed this Nov 2, 2026
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.

5 participants