diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-09-18 14:02:23 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-09-18 14:02:32 -0700 |
| commit | ad92bf7ab5e1fa0256be28fea51ab0698ab03453 (patch) | |
| tree | 9f10730b61b2aa54248392104b1c9eee35fb074e /macos/Sources/Features | |
| parent | da9334dce562658a3e49be67ccfeafda697bdbc6 (diff) | |
macos: bell-features=title works again
This was a regression we didn't fix before 1.2.
Diffstat (limited to 'macos/Sources/Features')
| -rw-r--r-- | macos/Sources/Features/Terminal/BaseTerminalController.swift | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/macos/Sources/Features/Terminal/BaseTerminalController.swift b/macos/Sources/Features/Terminal/BaseTerminalController.swift index 9c94cfef8..2de967daf 100644 --- a/macos/Sources/Features/Terminal/BaseTerminalController.swift +++ b/macos/Sources/Features/Terminal/BaseTerminalController.swift @@ -688,6 +688,8 @@ class BaseTerminalController: NSWindowController, surfaceTree.contains(titleSurface) { // If we have a surface, we want to listen for title changes. titleSurface.$title + .combineLatest(titleSurface.$bell) + .map { [weak self] in self?.computeTitle(title: $0, bell: $1) ?? "" } .sink { [weak self] in self?.titleDidChange(to: $0) } .store(in: &focusedSurfaceCancellables) } else { @@ -695,8 +697,17 @@ class BaseTerminalController: NSWindowController, titleDidChange(to: "👻") } } + + private func computeTitle(title: String, bell: Bool) -> String { + var result = title + if (bell && ghostty.config.bellFeatures.contains(.title)) { + result = "🔔 \(result)" + } + + return result + } - func titleDidChange(to: String) { + private func titleDidChange(to: String) { guard let window else { return } // Set the main window title |
