Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5645323
feat(sidebar): add configurable workspace font size
austinywang May 26, 2026
b3adb26
Merge remote-tracking branch 'origin/main' into issue-2643-allow-cust…
austinywang May 26, 2026
cd5b056
fix(sidebar): load sidebar font size off main actor
austinywang May 26, 2026
96530e3
merge: sync with main
austinywang May 30, 2026
b29ab4a
fix: address sidebar font review feedback
austinywang May 30, 2026
3e9fab6
feat: add sidebar font size controls
austinywang May 30, 2026
98e86e4
fix: prefer host zig for helper builds
austinywang May 30, 2026
d472eb3
fix: prefer apple silicon zig on mac runners
austinywang May 30, 2026
9a5875a
fix: prebuild ghostty helper in release workflows
austinywang May 30, 2026
e47150b
fix: use homebrew zig on mac ci
austinywang May 30, 2026
1104afa
fix: keep release helper skip arch-valid
austinywang May 30, 2026
1108491
fix: address sidebar font size settings feedback
austinywang May 30, 2026
41d3a45
fix: cancel sidebar font size refresh tasks
austinywang May 30, 2026
0deaee1
test: update cli config help contract
austinywang May 30, 2026
2590b47
feat: add workspace tab bar font size control + fix font-size slider …
austinywang May 30, 2026
50ba58e
Merge remote-tracking branch 'origin/main' into issue-2643-allow-cust…
austinywang May 31, 2026
b4d9cd7
fix: render font-size sliders in CmuxSettingsUI (settings moved to pa…
austinywang May 31, 2026
aa67955
Merge remote-tracking branch 'origin/main' into tab-icon-scaling-wt
austinywang May 31, 2026
e72fe3e
fix: surface font-size save failures in Settings
austinywang Jun 1, 2026
df961f7
fix: localize font-size value label ("%@ pt")
austinywang Jun 1, 2026
bfa4262
fix: seed sidebar font scale from on-disk config at launch
austinywang Jun 1, 2026
b505523
fix: move font-size config disk I/O off the main actor
austinywang Jun 1, 2026
8f1fc6e
fix: serialize font writes; harden config path/parse + stub arch
austinywang Jun 1, 2026
d397be5
fix: strip BOM when parsing Ghostty config at runtime load
austinywang Jun 1, 2026
c1cfd4b
chore: address CodeRabbit nitpicks (host-arch dedupe, localized format)
austinywang Jun 1, 2026
c41daff
fix: render font-size value label via localizedStringWithFormat
austinywang Jun 1, 2026
fdf1876
vendor/bonsplit: scale tab + control icons with tab bar font size
austinywang Jun 1, 2026
9b85a9c
feat: cap tab bar font size at 14pt
austinywang Jun 1, 2026
22f4094
fix: cancel in-flight font-size save before starting a new one
austinywang Jun 1, 2026
04f275f
test: use in-range 14 for tab-bar font loader test (was 16, now clamped)
austinywang Jun 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 151 additions & 52 deletions Sources/ContentView.swift

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions Sources/GhosttyConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ struct GhosttyConfig {

private static let loadCacheLock = NSLock()
private static var cachedConfigsByColorScheme: [ColorSchemePreference: GhosttyConfig] = [:]
static let defaultSidebarFontSize: CGFloat = 12.5
static let minSidebarFontSize: CGFloat = 10
static let maxSidebarFontSize: CGFloat = 20

var fontFamily: String = "Menlo"
var fontSize: CGFloat = 12
var surfaceTabBarFontSize: CGFloat = 11
var sidebarFontSize: CGFloat = Self.defaultSidebarFontSize
var theme: String?
var workingDirectory: String?
// Ghostty measures scrollback-limit in bytes, not lines.
Expand Down Expand Up @@ -394,6 +398,10 @@ struct GhosttyConfig {
if let size = Double(value) {
surfaceTabBarFontSize = CGFloat(size)
}
case "sidebar-font-size":
if let size = Double(value), size.isFinite {
sidebarFontSize = Self.clampedSidebarFontSize(CGFloat(size))
Comment thread
cursor[bot] marked this conversation as resolved.
}
case "theme":
theme = value
if let preferredColorScheme {
Expand Down Expand Up @@ -655,6 +663,11 @@ struct GhosttyConfig {
return parsed
}

static func clampedSidebarFontSize(_ value: CGFloat) -> CGFloat {
guard value.isFinite else { return defaultSidebarFontSize }
return min(max(value, minSidebarFontSize), maxSidebarFontSize)
}

private static func parseBackgroundBlur(_ value: String) -> GhosttyBackgroundBlur? {
switch value {
case "false", "0":
Expand Down
5 changes: 3 additions & 2 deletions Sources/ShortcutHintPill.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ extension View {
text: String?,
emphasis: Double,
offsetX: Double,
offsetY: Double
offsetY: Double,
fontSize: CGFloat = 10
) -> some View {
overlay(alignment: .topTrailing) {
if let text {
ShortcutHintPill(text: text, fontSize: 10, emphasis: emphasis)
ShortcutHintPill(text: text, fontSize: fontSize, emphasis: emphasis)
.offset(
x: ShortcutHintDebugSettings.clamped(offsetX),
y: ShortcutHintDebugSettings.clamped(offsetY)
Expand Down
7 changes: 4 additions & 3 deletions Sources/Sidebar/SidebarDirectoryText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ import SwiftUI
struct SidebarDirectoryText: View {
let candidates: [String]
let color: Color
var fontScale: CGFloat = 1

var body: some View {
if candidates.count <= 1 {
Text(candidates.first ?? "")
.font(.system(size: 10, design: .monospaced))
.font(.system(size: 10 * fontScale, design: .monospaced))
.foregroundColor(color)
.lineLimit(1)
.truncationMode(.tail)
} else {
ViewThatFits(in: .horizontal) {
ForEach(Array(candidates.dropLast().enumerated()), id: \.offset) { _, candidate in
Text(candidate)
.font(.system(size: 10, design: .monospaced))
.font(.system(size: 10 * fontScale, design: .monospaced))
.foregroundColor(color)
.lineLimit(1)
.fixedSize(horizontal: true, vertical: false)
}
Text(candidates.last ?? "")
.font(.system(size: 10, design: .monospaced))
.font(.system(size: 10 * fontScale, design: .monospaced))
.foregroundColor(color)
.lineLimit(1)
.truncationMode(.tail)
Expand Down
70 changes: 70 additions & 0 deletions cmuxTests/GhosttyConfigTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4293,6 +4293,76 @@ final class SidebarBackgroundConfigTests: XCTestCase {
}
}

final class SidebarFontSizeConfigTests: XCTestCase {
func testDefaultSidebarFontSizeMatchesSidebarTitleBaseline() {
let config = GhosttyConfig()

XCTAssertEqual(config.sidebarFontSize, 12.5, accuracy: 0.0001)
XCTAssertEqual(config.sidebarFontSize, GhosttyConfig.defaultSidebarFontSize, accuracy: 0.0001)
}

func testParseSidebarFontSizeIntegerValue() {
var config = GhosttyConfig()

config.parse("sidebar-font-size = 14")

XCTAssertEqual(config.sidebarFontSize, 14, accuracy: 0.0001)
}

func testParseSidebarFontSizeFractionalValue() {
var config = GhosttyConfig()

config.parse("sidebar-font-size = 13.75")

XCTAssertEqual(config.sidebarFontSize, 13.75, accuracy: 0.0001)
}

func testParseSidebarFontSizeClampsBelowMinimum() {
var config = GhosttyConfig()

config.parse("sidebar-font-size = 4")

XCTAssertEqual(config.sidebarFontSize, GhosttyConfig.minSidebarFontSize, accuracy: 0.0001)
}

func testParseSidebarFontSizeClampsAboveMaximum() {
var config = GhosttyConfig()

config.parse("sidebar-font-size = 48")

XCTAssertEqual(config.sidebarFontSize, GhosttyConfig.maxSidebarFontSize, accuracy: 0.0001)
}

func testParseSidebarFontSizeIgnoresInvalidAndNonFiniteValues() {
var config = GhosttyConfig()

config.parse("sidebar-font-size = 14")
config.parse(
"""
sidebar-font-size = not-a-number
sidebar-font-size = nan
sidebar-font-size = inf
"""
)

XCTAssertEqual(config.sidebarFontSize, 14, accuracy: 0.0001)
}

func testLoadUsesParsedSidebarFontSizeFromInjectedLoader() {
let loaded = GhosttyConfig.load(
preferredColorScheme: .dark,
useCache: false,
loadFromDisk: { _ in
var config = GhosttyConfig()
config.parse("sidebar-font-size = 15")
return config
}
)

XCTAssertEqual(loaded.sidebarFontSize, 15, accuracy: 0.0001)
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

final class ZshShellIntegrationHandoffTests: XCTestCase {
func testGhosttyPromptHooksLoadWhenCmuxRequestsZshIntegration() throws {
let output = try runInteractiveZsh(cmuxLoadGhosttyIntegration: true)
Expand Down
44 changes: 44 additions & 0 deletions cmuxTests/SidebarOrderingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,50 @@ final class SidebarActiveTabIndicatorSettingsTests: XCTestCase {
}
}

final class SidebarTabItemFontScaleTests: XCTestCase {
func testDefaultSidebarFontScaleIsUnitScale() throws {
let scale = SidebarTabItemFontScale.scale(for: GhosttyConfig.defaultSidebarFontSize)

XCTAssertEqual(scale, 1, accuracy: 0.0001)
}

func testSidebarFontScaleIsProportionalToDefaultSidebarSize() throws {
let scale = SidebarTabItemFontScale.scale(for: 18)

XCTAssertEqual(
scale,
18 / GhosttyConfig.defaultSidebarFontSize,
accuracy: 0.0001
)
}

func testSidebarFontScaleClampsSmallSizes() throws {
let scale = SidebarTabItemFontScale.scale(for: 4)

XCTAssertEqual(
scale,
GhosttyConfig.minSidebarFontSize / GhosttyConfig.defaultSidebarFontSize,
accuracy: 0.0001
)
}

func testSidebarFontScaleClampsLargeSizes() throws {
let scale = SidebarTabItemFontScale.scale(for: 48)

XCTAssertEqual(
scale,
GhosttyConfig.maxSidebarFontSize / GhosttyConfig.defaultSidebarFontSize,
accuracy: 0.0001
)
}

func testSidebarFontScaleFallsBackToDefaultForNonFiniteValue() throws {
let scale = SidebarTabItemFontScale.scale(for: CGFloat.nan)

XCTAssertEqual(scale, 1, accuracy: 0.0001)
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated


final class SidebarRemoteErrorCopySupportTests: XCTestCase {
func testMenuLabelIsNilWhenThereAreNoErrors() {
Expand Down
1 change: 1 addition & 0 deletions web/app/[locale]/docs/configuration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ touch ~/.config/ghostty/config`}</CodeBlock>
<DocsHeading level={2} id="example-config">{t("exampleConfig")}</DocsHeading>
<CodeBlock title="~/.config/ghostty/config" lang="ini">{`font-family = SF Mono
font-size = 13
sidebar-font-size = 14
theme = One Dark
scrollback-limit = 50000000
split-divider-color = #3e4451
Expand Down
Loading