Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
68 changes: 68 additions & 0 deletions Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -49469,6 +49469,74 @@
}
}
},
"settings.app.globalFontMagnification" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Global Font Magnification"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "グローバルフォント倍率"
}
}
}
},
"settings.app.globalFontMagnification.subtitleOff" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Scale every font in cmux by the same percentage. 100% = design size."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "cmux のすべてのフォントを同じ割合でスケーリングします。100% = 設計サイズ。"
}
}
}
},
"settings.app.globalFontMagnification.subtitleOn" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Terminals, tabs, and chrome all render at this magnification. Per-pane zoom (⌘= / ⌘-) still overrides for the focused pane."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "ターミナル、タブ、UI をこの倍率で描画します。ペインごとのズーム (⌘= / ⌘-) はフォーカス中のペインに対して引き続き優先されます。"
}
}
}
},
"settings.app.globalFontMagnification.reset" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Reset"
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "リセット"
}
}
}
},
"settings.app.newWorkspacePlacement": {
"extractionState": "manual",
"localizations": {
Expand Down
20 changes: 20 additions & 0 deletions Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
private var activeConfiguredShortcutChordPrefixForCurrentEvent: ShortcutStroke?
private var configuredShortcutChordActions: [KeyboardShortcutSettings.Action] = []
private var ghosttyConfigObserver: NSObjectProtocol?
private var globalFontSizeObserver: NSObjectProtocol?
private var ghosttyGotoSplitLeftShortcut: StoredShortcut?
private var ghosttyGotoSplitRightShortcut: StoredShortcut?
private var ghosttyGotoSplitUpShortcut: StoredShortcut?
Expand Down Expand Up @@ -1010,6 +1011,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
installMainWindowKeyObserver()
refreshGhosttyGotoSplitShortcuts()
installGhosttyConfigObserver()
installGlobalFontSizeObserver()
installWindowResponderSwizzles()
installBrowserAddressBarFocusObservers()
installShortcutMonitor()
Expand Down Expand Up @@ -9039,6 +9041,24 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
}
}

private func installGlobalFontSizeObserver() {
guard globalFontSizeObserver == nil else { return }
globalFontSizeObserver = NotificationCenter.default.addObserver(
forName: GlobalFontMagnification.didChangeNotification,
object: nil,
queue: .main
) { _ in
// Push the new magnification into the live Ghostty config so existing
// terminals reflow. Called for UI-driven and cmux.json-driven
// changes — the reload is idempotent so double-reloads are fine.
GhosttyConfig.invalidateLoadCache()
GhosttyApp.shared.reloadConfiguration(
source: "globalFontMagnificationDidChange",
reloadSettingsFromFile: false
)
}
}

private func refreshGhosttyGotoSplitShortcuts() {
guard let config = GhosttyApp.shared.config else {
ghosttyGotoSplitLeftShortcut = nil
Expand Down
Loading