mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-09-05 19:08:17 +00:00
Add bell feature flags for audio, attention, and title actions on macOS (#7533)
Resolve #7526
This commit is contained in:
@@ -537,11 +537,13 @@ class AppDelegate: NSObject,
|
||||
}
|
||||
|
||||
@objc private func ghosttyBellDidRing(_ notification: Notification) {
|
||||
// Bounce the dock icon if we're not focused.
|
||||
NSApp.requestUserAttention(.informationalRequest)
|
||||
if (ghostty.config.bellFeatures.contains(.attention)) {
|
||||
// Bounce the dock icon if we're not focused.
|
||||
NSApp.requestUserAttention(.informationalRequest)
|
||||
|
||||
// Handle setting the dock badge based on permissions
|
||||
ghosttyUpdateBadgeForBell()
|
||||
// Handle setting the dock badge based on permissions
|
||||
ghosttyUpdateBadgeForBell()
|
||||
}
|
||||
}
|
||||
|
||||
private func ghosttyUpdateBadgeForBell() {
|
||||
|
@@ -566,6 +566,9 @@ extension Ghostty.Config {
|
||||
let rawValue: CUnsignedInt
|
||||
|
||||
static let system = BellFeatures(rawValue: 1 << 0)
|
||||
static let audio = BellFeatures(rawValue: 1 << 1)
|
||||
static let attention = BellFeatures(rawValue: 1 << 2)
|
||||
static let title = BellFeatures(rawValue: 1 << 3)
|
||||
}
|
||||
|
||||
enum MacHidden : String {
|
||||
|
@@ -59,7 +59,7 @@ extension Ghostty {
|
||||
|
||||
var title: String {
|
||||
var result = surfaceView.title
|
||||
if (surfaceView.bell) {
|
||||
if (surfaceView.bell && ghostty.config.bellFeatures.contains(.title)) {
|
||||
result = "🔔 \(result)"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user