Skip to content

Widen font-size bounds + add Terminal Font Size setting#5338

Open
lawrencecchen wants to merge 1 commit into
mainfrom
feat-configurable-font-sizes
Open

Widen font-size bounds + add Terminal Font Size setting#5338
lawrencecchen wants to merge 1 commit into
mainfrom
feat-configurable-font-sizes

Conversation

@lawrencecchen
Copy link
Copy Markdown
Contributor

@lawrencecchen lawrencecchen commented Jun 4, 2026

Lets the terminal, sidebar, and tab-bar fonts go smaller and bigger, and adds a Settings control for the terminal font.

  • Sidebar font range 10–20 → 4–48.
  • Tab-bar font range 8–14 → 4–48.
  • New Terminal Font Size slider in Settings → Terminal, backed by the Ghostty font-size key (default 12, range 4–72). It sets the base terminal font; the live Cmd +/− zoom stays handled by libghostty and is not bounded by this range.

Localized en + ja. Bounds-clamp tests updated to use inputs beyond the new ranges, plus new terminal font-size clamp tests. No new files (existing Section/host-action wiring reused).

This is phase 1 of the request (wider ranges). Two follow-ups are pending a product decision: per-font configurable min/max limits, and a global UI/app font scale (a larger cross-cutting change).


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
UI and Ghostty config persistence for font sizes; no auth or security-sensitive paths, with existing clamp/reload patterns reused.

Overview
Widens sidebar and tab-bar font sliders (4–48 pt) and adds a Terminal Font Size control in Settings → Terminal that persists Ghostty font-size (default 12, 4–72 pt) with live reload—the slider sets the base size; Cmd +/- zoom is unchanged.

Parsing and CmuxGhosttyConfigSettingEditor now clamp terminal font-size on load; settings search/localization (en/ja) and tests were updated for the new bounds and terminal setting.

Reviewed by Cursor Bugbot for commit 40b5716. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Expanded font-size controls and added a Terminal Font Size setting so users can scale terminal, sidebar, and tab titles more flexibly. The terminal control sets the base font via Ghostty while Cmd +/- live zoom stays unchanged.

  • New Features
    • Sidebar font range: 10–20 → 4–48.
    • Tab bar font range: 8–14 → 4–48.
    • New Terminal Font Size slider in Settings → Terminal (backs font-size; default 12, range 4–72). Sets the base size; Cmd +/- zoom remains handled by libghostty and is not bounded.
    • Localized (en/ja), updated settings search aliases/index, and added clamp tests for the new ranges and terminal size.

Written for commit 40b5716. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added dedicated terminal font size adjustment control with slider and reset functionality.
    • Expanded font size adjustment ranges for sidebar and tab bar (minimum now 4 points).
    • Includes error messaging when font size changes fail to save.
  • Tests

    • Updated and added tests for new font sizing configuration and clamping behavior.

Lets terminal/sidebar/tab-bar fonts go smaller and bigger:
- Sidebar font range 10-20 -> 4-48, tab-bar font 8-14 -> 4-48.
- New Terminal Font Size slider in Settings > Terminal, backed by the
  Ghostty `font-size` config key (default 12, range 4-72). Sets the base
  terminal font; the live Cmd +/- zoom remains handled by libghostty and
  is not bounded by this range.

Localized en + ja. Updated the bounds-clamp tests to use inputs beyond the
new ranges and added terminal font-size clamp coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 4, 2026 5:20am
cmux-staging Building Building Preview, Comment Jun 4, 2026 5:20am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces terminal font size as a configurable setting in the Ghostty terminal UI. It extends the existing font-size infrastructure with new config bounds, adds protocol methods to query and persist terminal font sizes, implements terminal font persistence in the settings view, and integrates search/localization support.

Changes

Terminal Font Size Settings

Layer / File(s) Summary
Core configuration foundation
Sources/GhosttyConfig.swift, Sources/CmuxApplicationSupportDirectories.swift
GhosttyConfig defines terminal font-size bounds constants (defaultTerminalFontSize, minTerminalFontSize, maxTerminalFontSize) and updates fontSize default parsing to validate finite values and apply clamping via a new clampedTerminalFontSize helper. CmuxApplicationSupportDirectories adds terminal font size constants, clamp/format/parse functions, and widens existing sidebar/surface font-size bounds.
Protocol definition and host implementation
Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Environment/SettingsHostActions.swift, Sources/HostSettingsActions.swift
SettingsHostActions protocol gains terminalFontSize() -> SettingsFontSize getter and setTerminalFontSize(_ points: Double) async -> Bool setter with extension defaults; HostSettingsActions implements both to read/persist cached Ghostty fontSize with proper bounds wrapping and async disk-write semantics.
Terminal section UI and state management
Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/TerminalSection.swift
Adds @State fields for terminal font persistence (terminalFont, terminalFontSaveFailed, terminalFontSaveTask), initializes state from host actions on construction, implements saveTerminalFontSize with cancellation awareness, and renders a slider/reset control with error messaging.
Settings search and navigation
Sources/SettingsNavigation.swift, Sources/SettingsSearchAliases.swift
Registers terminal font-size setting in settings index with localized title key and adds search alias entry for discovery via font-size/terminal/scale terms.
Localization and search strings
Resources/Localizable.xcstrings
Adds translated entries for search alias (settings.search.alias.setting.terminal.font-size) and UI labels (settings.terminal.fontSize, .reset, .saveFailed, .subtitle) in English and Japanese.
Test coverage and validation
cmuxTests/GhosttyConfigTests.swift, cmuxTests/SidebarOrderingTests.swift
New font-size test suite validates default, fractional parsing, below-min/above-max clamping, and editor "last value wins" behavior; existing sidebar/surface font-size tests updated to exercise expanded clamp boundaries (inputs now 1 and 96).

Sequence Diagram

sequenceDiagram
  participant TerminalSection as TerminalSection<br/>(UI)
  participant HostActions as HostSettingsActions<br/>(API)
  participant GhosttyConfig as GhosttyConfig<br/>(Data Model)
  participant CmuxEditor as CmuxGhosttyConfigSettingEditor<br/>(Config I/O)
  
  TerminalSection->>HostActions: terminalFontSize()
  HostActions->>GhosttyConfig: read fontSize + bounds constants
  GhosttyConfig->>HostActions: fontSize + min/max/default
  HostActions->>TerminalSection: SettingsFontSize object
  
  TerminalSection->>TerminalSection: User adjusts slider
  TerminalSection->>HostActions: setTerminalFontSize(points)
  HostActions->>GhosttyConfig: clampedTerminalFontSize(value)
  GhosttyConfig->>CmuxEditor: clampedTerminalFontSize(value)
  CmuxEditor->>GhosttyConfig: clamped CGFloat
  HostActions->>CmuxEditor: persistFontSize(terminalFontSizeKey, ...)
  CmuxEditor->>CmuxEditor: write config + reload
  HostActions->>TerminalSection: success (Bool)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • manaflow-ai/cmux#4798: Related because it establishes the same Ghostty font-size configuration infrastructure (CmuxGhosttyConfigSettingEditor bounds/parsing) and slider range updates that this PR extends with terminal-font-size support.

Poem

🐰 A rabbit hops through settings fine,
Terminal fonts now bold and mine,
Adjustable in twelve or more,
Each point persists from shore to shore,
Clamped with care, oh what delight!


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (2 errors, 1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Cmux Swift @Concurrent ❌ Error New async method setTerminalFontSize performs file I/O off main actor without @concurrent or nonisolated annotation, violating the swift-concurrent-annotation rule. Mark setTerminalFontSize with @concurrent or nonisolated in both protocol and HostSettingsActions implementation.
Cmux Full Internationalization ❌ Error New localization keys for terminal font size have only 2 locales (en, ja) but catalog supports 20 total locales per full-internationalization.md rule. Add translated entries for all 20 locales to new string keys in Resources/Localizable.xcstrings.
Docstring Coverage ⚠️ Warning Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description covers what changed (font range expansions and new terminal setting) and why (more flexibility), but lacks explicit testing details and a demo video as specified in the template. Add specific testing methodology details (e.g., how each font size bound was tested) and include a demo video link if UI changes were made, per the template requirements.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: widening font-size bounds and adding a new Terminal Font Size setting, which are the primary objectives of this PR.
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.
Cmux Swift Actor Isolation ✅ Passed All new code properly adheres to Swift 6 actor isolation: @MainActor protocol and class for UI service, new FontConfigWriter actor for async I/O, Sendable value types, no mutable shared references.
Cmux Swift Blocking Runtime ✅ Passed No blocking patterns introduced. New async methods use async/await with FontConfigWriter actor, and UI updates use proper Task cancellation with isCancelled checks.
Cmux No Hacky Sleeps ✅ Passed PR contains only Swift and localization changes; the rule explicitly excludes Swift (handled by separate rule) and covers only TypeScript, JavaScript, shell, or build/runtime scripts.
Cmux Algorithmic Complexity ✅ Passed No violations found. Changes add O(1) font-size clamping getters/setters, test cases, and configuration entries—no collection scans or nested loops.
Cmux Swift Concurrency ✅ Passed Uses modern async/await patterns with proper task management, serial actor for writes, no legacy Dispatch or Combine. Fire-and-forget Task in KVO is allowed per rules.
Cmux Swift File And Package Boundaries ✅ Passed No new files exceed thresholds; GhosttyConfig adds only 10 lines; UI/state/persistence mixing acceptable for SwiftUI settings section; feature logic properly integrated with Ghostty config.
Cmux Swift Logging ✅ Passed No violations of swift-logging.md: no print/debugPrint/dump/NSLog in app code; Logger uses proper private file-scoped declaration with privacy redaction for non-sensitive config keys.
Cmux User-Facing Error Privacy ✅ Passed All user-facing messages comply with privacy rules: error messages are generic ("Couldn't save terminal font size"), expose no sensitive data, vendor names, credentials, or implementation details.
Cmux Swiftui State Layout ✅ Passed PR replicates pre-existing TerminalSection state pattern for terminal font; no new ObservableObject/@published, no render-time mutations, all state writes in proper event handlers/async callbacks.
Cmux Architecture Rethink ✅ Passed Font-size setting reuses established cancellation-aware task and serial writer patterns with clear ownership; no timing repairs, polling, or split UI lifecycle.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR adds terminal font-size setting via SwiftUI View slider (TerminalSection), not standalone windows. No NSWindow/NSPanel/NSWindowController/Window/WindowGroup objects created.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-configurable-font-sizes

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 and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40b57167d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +407 to +408
if let size = Double(value), size.isFinite {
fontSize = Self.clampedTerminalFontSize(CGFloat(size))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve user-authored terminal font sizes

When users already have a Ghostty font-size outside the new Settings slider range, this parse path now silently clamps their config on every load (for example font-size = 96 renders as 72), whereas the previous behavior preserved any finite value. The Settings setter already clamps values before writing, so the clamp should stay at the UI persistence boundary rather than changing how existing hand-authored Ghostty configs are interpreted.

Useful? React with 👍 / 👎.

Comment on lines +104 to +106
SettingsCardRow(
configurationReview: .settingsOnly,
String(localized: "settings.terminal.fontSize", defaultValue: "Terminal Font Size"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Anchor the new row in the active settings search

The shipped Settings window builds its sidebar search from CmuxSettingsUI.SettingsSearchIndex/CuratedSettingEntry+Default, not the legacy Sources/SettingsNavigation table updated in this commit; because this new .settingsOnly row also has no explicit searchAnchorID, searching for terminal font size cannot surface or scroll/highlight this row in the active settings UI. Add the entry to the package search index and give this settings-only row the matching anchor so the new setting is discoverable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 40b5716. Configure here.

if let size = Double(value) {
fontSize = CGFloat(size)
if let size = Double(value), size.isFinite {
fontSize = Self.clampedTerminalFontSize(CGFloat(size))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Clamped parse desyncs terminal UI

Low Severity

Parsing font-size now clamps into GhosttyConfig.fontSize, while libghostty still applies the raw config value on reload. The new terminal font slider and TextBox sizing read the clamped Swift value, so they can disagree with the live terminal when font-size is outside 4–72 pt.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 40b5716. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 4, 2026

Greptile Summary

Widens the sidebar (10–20 → 4–48) and tab-bar (8–14 → 4–48) font-size bounds, and introduces a new Terminal Font Size setting backed by Ghostty's font-size config key (default 12, range 4–72). A dedicated Settings slider in the Terminal section lets users set the base terminal font; live Cmd +/– zoom continues to be handled by libghostty outside these bounds.

  • New terminalFontSize / setTerminalFontSize protocol + implementation follows the established sidebar/tab-bar pattern: cached-config read, serial-actor file write, task-cancellation on rapid slider releases, and a save-failed error row.
  • GhosttyConfig parse path now clamps font-size to [4, 72] and adds the missing isFinite guard that was absent from the original font-size case (sidebar and tab-bar already had it).
  • Bounds-clamp tests are updated to use inputs that fall outside the new wider ranges, and five new terminal font-size tests cover default, fractional, below-minimum, above-maximum, and last-value-wins scenarios.

Confidence Score: 4/5

Safe to merge. The new Terminal Font Size control is a clean addition that follows established patterns, and the wider sidebar/tab-bar bounds are a straightforward constant update backed by updated tests.

The implementation is consistent with the existing sidebar and tab-bar font-size features. The only gap is that the five new user-facing strings land without translations for 19 of the 21 locales already in the catalog, which matches the existing pattern for similar strings but still leaves new Settings copy untranslated for most non-en/ja users.

Resources/Localizable.xcstrings — new Terminal Font Size strings are present in en and ja only.

Important Files Changed

Filename Overview
Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Environment/SettingsHostActions.swift Adds terminalFontSize() and setTerminalFontSize(_:) to the protocol with correct default stubs; range/default constants are consistent with the editor layer.
Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/TerminalSection.swift Adds Terminal Font Size slider row; state management, task-cancellation pattern, and save/fail UI match the existing tab-bar font size row exactly.
Resources/Localizable.xcstrings Adds 5 new string keys (label, subtitle, reset, saveFailed, search alias) localized for en and ja only; the other 19 locales supported by this catalog are absent from all new entries.
Sources/CmuxApplicationSupportDirectories.swift Adds terminal font-size key/constants and clamp/format/parse helpers following the exact pattern used for sidebar and tab-bar; clamp correctly guards against non-finite inputs.
Sources/GhosttyConfig.swift Adds clamping of font-size at parse time and exposes min/max/default constants; also adds isFinite guard that was missing from the original font-size case, correcting a pre-existing gap where inf/nan would have been accepted.
Sources/HostSettingsActions.swift Implements terminalFontSize() and setTerminalFontSize(_:) using the same cached-config + serial-actor persistFontSize pattern as the other font-size actions.
Sources/SettingsNavigation.swift Inserts terminal font-size entry into the search index; the section/suffix pair is unique and consistent with the sidebar counterpart already present.
cmuxTests/GhosttyConfigTests.swift Updates bounds-clamp tests to use inputs outside the new wider ranges; adds five terminal font-size tests covering default, fractional, clamp-below, clamp-above, and multi-occurrence/last-wins parse behaviour.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User drags slider / taps Reset\nTerminalSection.swift] --> B[saveTerminalFontSize points]
    B --> C{terminalFontSaveTask?\ncancel previous}
    C --> D[Task: await setTerminalFontSize]
    D --> E[HostSettingsActions\nclampedTerminalFontSize\n4–72]
    E --> F[persistFontSize key=font-size\nserial fontConfigWriter actor]
    F --> G{Write succeeded?}
    G -->|yes| H[Reload Ghostty config\npost ghosttyConfigDidReload]
    G -->|no| I[terminalFontSaveFailed = true\nshow error row]
    H --> J[GhosttyConfig.load\nparses font-size\nclamped to 4–72]
    J --> K[Settings slider shows\nnew clamped value]
    J --> L[TerminalPanelView.terminalFontSize\nupdated for TextBox font]
Loading

Reviews (1): Last reviewed commit: "Widen font-size bounds + add Terminal Fo..." | Re-trigger Greptile

Comment on lines 115203 to 115225
}
}
},
"settings.search.alias.setting.terminal.font-size": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "font-size terminal font size text scale shell zoom bigger smaller larger point base"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "font-size terminal font size ターミナル フォントサイズ テキスト 拡大 縮小 ズーム 大きく 小さく ポイント"
}
}
}
},
"settings.search.alias.setting.terminal.tab-bar-font-size": {
"extractionState": "manual",
"localizations": {
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.

P2 New strings missing translations for 19 locales

The catalog contains 21 locales (ar, bs, da, de, en, es, fr, it, ja, km, ko, nb, ok, pl, pt, pt-BR, px, ru, th, tr, uk), but all five new keys (settings.terminal.fontSize, .subtitle, .reset, .saveFailed, and settings.search.alias.setting.terminal.font-size) only carry en and ja entries. Any user running cmux in one of the other 19 locales will fall back to the English default at runtime, making the new Terminal Font Size setting and its error copy untranslated. This matches the pattern of the adjacent tab-bar font strings, but it still means new user-facing copy is landing without coverage across the supported locales.

Rule Used: Flag production user-facing text that is not fully... (source)

coderabbitai[bot]
coderabbitai Bot previously requested changes Jun 4, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Sources/SettingsNavigation.swift`:
- Line 348: The settings registration adds a "font-size" settings path for the
terminal but SettingsSearchIndex.anchorID(forSettingsPath:) lacks a "font-size"
case, so deep-linking fails; update
SettingsSearchIndex.anchorID(forSettingsPath:) to include a mapping for the
"font-size" key (matching the terminal setting registered in SettingsNavigation,
e.g., the .terminal font-size entry) and return the same anchor identifier used
for the terminal font-size setting so config-path navigation/hightlight resolves
correctly; locate the anchorID switch/case (or dictionary) and add the
"font-size" branch returning the terminal font-size anchor.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4cb6d242-07d2-4153-8740-e413b436230a

📥 Commits

Reviewing files that changed from the base of the PR and between 9d926e2 and 40b5716.

📒 Files selected for processing (10)
  • Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Environment/SettingsHostActions.swift
  • Packages/CmuxSettingsUI/Sources/CmuxSettingsUI/Sections/TerminalSection.swift
  • Resources/Localizable.xcstrings
  • Sources/CmuxApplicationSupportDirectories.swift
  • Sources/GhosttyConfig.swift
  • Sources/HostSettingsActions.swift
  • Sources/SettingsNavigation.swift
  • Sources/SettingsSearchAliases.swift
  • cmuxTests/GhosttyConfigTests.swift
  • cmuxTests/SidebarOrderingTests.swift

setting(.app, "palette-search-all", String(localized: "settings.app.commandPaletteSearchAllSurfaces", defaultValue: "Command Palette Searches All Surfaces"), "cmd p search terminal browser markdown"),
setting(.terminal, "scrollbar", String(localized: "settings.terminal.scrollBar", defaultValue: "Show Terminal Scroll Bar"), "terminal shell scrollback"),
setting(.terminal, "copy-on-select", String(localized: "settings.terminal.copyOnSelect", defaultValue: "Copy on Selection"), "terminal.copyOnSelect clipboard selection mouse double click triple click"),
setting(.terminal, "font-size", String(localized: "settings.terminal.fontSize", defaultValue: "Terminal Font Size"), "font size text scale terminal shell zoom bigger smaller font-size point"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add missing font-size settings-path anchor mapping for terminal font size.

Line 348 registers the searchable setting, but SettingsSearchIndex.anchorID(forSettingsPath:) has no "font-size" entry. Since terminal font persistence uses the Ghostty font-size key (Sources/HostSettingsActions.swift:209-215), deep-link/highlight flows from config-path navigation can fail to resolve this setting.

🔧 Proposed fix
     private static let settingsPathAnchorIDs: [String: String] = [
+        "font-size": settingID(for: .terminal, idSuffix: "font-size"),
         "rightSidebar.beta.feed.enabled": settingID(for: .betaFeatures, idSuffix: "feed"),
         "rightSidebar.beta.dock.enabled": settingID(for: .betaFeatures, idSuffix: "dock"),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Sources/SettingsNavigation.swift` at line 348, The settings registration adds
a "font-size" settings path for the terminal but
SettingsSearchIndex.anchorID(forSettingsPath:) lacks a "font-size" case, so
deep-linking fails; update SettingsSearchIndex.anchorID(forSettingsPath:) to
include a mapping for the "font-size" key (matching the terminal setting
registered in SettingsNavigation, e.g., the .terminal font-size entry) and
return the same anchor identifier used for the terminal font-size setting so
config-path navigation/hightlight resolves correctly; locate the anchorID
switch/case (or dictionary) and add the "font-size" branch returning the
terminal font-size anchor.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Sources/GhosttyConfig.swift">

<violation number="1" location="Sources/GhosttyConfig.swift:408">
P2: Parse-time clamping of `font-size` can desync the Settings UI from the live terminal. libghostty applies the raw config value, but this path now clamps into the Swift model. For hand-authored configs with values outside 4–72 (e.g. `font-size = 96`), the slider will show 72 while the terminal actually renders at 96. Since `setTerminalFontSize` already clamps before writing, the clamp here is redundant and silently misrepresents the user's actual config. Consider preserving any finite value at parse time (matching the previous behavior) and only enforcing the range on the Settings write path.</violation>
</file>

<file name="Sources/SettingsNavigation.swift">

<violation number="1" location="Sources/SettingsNavigation.swift:348">
P2: Missing `settingsPathAnchorIDs` entry for `"font-size"`. The search index now includes this setting, but `anchorID(forSettingsPath:)` has no mapping for it, so config-path deep-link/highlight navigation will fail to resolve the terminal font size row.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

if let size = Double(value) {
fontSize = CGFloat(size)
if let size = Double(value), size.isFinite {
fontSize = Self.clampedTerminalFontSize(CGFloat(size))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Parse-time clamping of font-size can desync the Settings UI from the live terminal. libghostty applies the raw config value, but this path now clamps into the Swift model. For hand-authored configs with values outside 4–72 (e.g. font-size = 96), the slider will show 72 while the terminal actually renders at 96. Since setTerminalFontSize already clamps before writing, the clamp here is redundant and silently misrepresents the user's actual config. Consider preserving any finite value at parse time (matching the previous behavior) and only enforcing the range on the Settings write path.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Sources/GhosttyConfig.swift, line 408:

<comment>Parse-time clamping of `font-size` can desync the Settings UI from the live terminal. libghostty applies the raw config value, but this path now clamps into the Swift model. For hand-authored configs with values outside 4–72 (e.g. `font-size = 96`), the slider will show 72 while the terminal actually renders at 96. Since `setTerminalFontSize` already clamps before writing, the clamp here is redundant and silently misrepresents the user's actual config. Consider preserving any finite value at parse time (matching the previous behavior) and only enforcing the range on the Settings write path.</comment>

<file context>
@@ -401,8 +404,8 @@ struct GhosttyConfig {
-                    if let size = Double(value) {
-                        fontSize = CGFloat(size)
+                    if let size = Double(value), size.isFinite {
+                        fontSize = Self.clampedTerminalFontSize(CGFloat(size))
                     }
                 case "surface-tab-bar-font-size":
</file context>
Suggested change
fontSize = Self.clampedTerminalFontSize(CGFloat(size))
fontSize = CGFloat(size)

setting(.app, "palette-search-all", String(localized: "settings.app.commandPaletteSearchAllSurfaces", defaultValue: "Command Palette Searches All Surfaces"), "cmd p search terminal browser markdown"),
setting(.terminal, "scrollbar", String(localized: "settings.terminal.scrollBar", defaultValue: "Show Terminal Scroll Bar"), "terminal shell scrollback"),
setting(.terminal, "copy-on-select", String(localized: "settings.terminal.copyOnSelect", defaultValue: "Copy on Selection"), "terminal.copyOnSelect clipboard selection mouse double click triple click"),
setting(.terminal, "font-size", String(localized: "settings.terminal.fontSize", defaultValue: "Terminal Font Size"), "font size text scale terminal shell zoom bigger smaller font-size point"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Missing settingsPathAnchorIDs entry for "font-size". The search index now includes this setting, but anchorID(forSettingsPath:) has no mapping for it, so config-path deep-link/highlight navigation will fail to resolve the terminal font size row.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Sources/SettingsNavigation.swift, line 348:

<comment>Missing `settingsPathAnchorIDs` entry for `"font-size"`. The search index now includes this setting, but `anchorID(forSettingsPath:)` has no mapping for it, so config-path deep-link/highlight navigation will fail to resolve the terminal font size row.</comment>

<file context>
@@ -345,6 +345,7 @@ enum SettingsSearchIndex {
         setting(.app, "palette-search-all", String(localized: "settings.app.commandPaletteSearchAllSurfaces", defaultValue: "Command Palette Searches All Surfaces"), "cmd p search terminal browser markdown"),
         setting(.terminal, "scrollbar", String(localized: "settings.terminal.scrollBar", defaultValue: "Show Terminal Scroll Bar"), "terminal shell scrollback"),
         setting(.terminal, "copy-on-select", String(localized: "settings.terminal.copyOnSelect", defaultValue: "Copy on Selection"), "terminal.copyOnSelect clipboard selection mouse double click triple click"),
+        setting(.terminal, "font-size", String(localized: "settings.terminal.fontSize", defaultValue: "Terminal Font Size"), "font size text scale terminal shell zoom bigger smaller font-size point"),
         setting(.terminal, "tab-bar-font-size", String(localized: "settings.terminal.tabBarFontSize", defaultValue: "Tab Bar Font Size"), "font size text scale terminal browser pane tab title surface-tab-bar-font-size"),
         setting(.terminal, "agent-auto-resume", String(localized: "settings.terminal.agentAutoResume", defaultValue: "Resume Agent Sessions on Reopen"), "terminal.autoResumeAgentSessions auto resume restore reopen relaunch quit sessions agents claude code codex opencode rovo dev rovodev toggle"),
</file context>

@lawrencecchen lawrencecchen dismissed coderabbitai[bot]’s stale review June 6, 2026 11:34

CodeRabbit now posts non-blocking comment reviews (request_changes_workflow=false, #5538).

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