mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-24 22:00:16 +00:00
Fixes the issue described in #12516. ### What - Inject an `OSPasteboard` into `SearchState` - Add `OSPasteboard` extension to normalize working with strings between UIPasteboard/NSPasteboard - Add `BackportSelectionTextField` which supports text selection for MacOS 15/iOS 18 and up. - Read from the pasteboard when the overlay opens and when the app becomes active - Write to the pasteboard when the search needle changes - Annotate `SearchState` as MainActor. `NSPasteboard` isn't thread safe, and since `SearchState` is already accessed from the main thread, MainActor enforces our writes be thread safe - Add SearchState unit tests ### Why Consistent with other macOS apps, the Find bar's search needle should persist when re-opened and should sync to the Find bar in other apps. For example, see Xcode, Notes, Terminal, and Safari. https://github.com/user-attachments/assets/b6a55a4a-a52c-45bc-ac38-c9df452c11cb