From dcb7c9a4b8eace183b1da65eac4c78a1c073f61e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Feb 2026 10:20:26 -0800 Subject: [PATCH] macos: show the notification count number in the badge --- macos/Sources/App/macOS/AppDelegate.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/macos/Sources/App/macOS/AppDelegate.swift b/macos/Sources/App/macOS/AppDelegate.swift index 194d20037..bcd9a0ffa 100644 --- a/macos/Sources/App/macOS/AppDelegate.swift +++ b/macos/Sources/App/macOS/AppDelegate.swift @@ -848,11 +848,11 @@ class AppDelegate: NSObject, } private func setDockBadge() { - let anyBell = NSApp.windows + let bellCount = NSApp.windows .compactMap { $0.windowController as? BaseTerminalController } - .contains { $0.bell } - let wantsBadge = ghostty.config.bellFeatures.contains(.attention) && anyBell - let label = wantsBadge ? "•" : nil + .reduce(0) { $0 + ($1.bell ? 1 : 0) } + let wantsBadge = ghostty.config.bellFeatures.contains(.attention) && bellCount > 0 + let label = wantsBadge ? (bellCount > 99 ? "99+" : String(bellCount)) : nil NSApp.dockTile.badgeLabel = label NSApp.dockTile.display() }