From 949a8ea53fbf5b319743cd378e73b5dc58623877 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 25 Nov 2025 20:05:48 -0800 Subject: [PATCH] macos: dummy search state for iOS --- macos/Sources/Ghostty/SurfaceView.swift | 2 ++ macos/Sources/Ghostty/SurfaceView_UIKit.swift | 3 +++ 2 files changed, 5 insertions(+) diff --git a/macos/Sources/Ghostty/SurfaceView.swift b/macos/Sources/Ghostty/SurfaceView.swift index 6d0cc21be..1718aeead 100644 --- a/macos/Sources/Ghostty/SurfaceView.swift +++ b/macos/Sources/Ghostty/SurfaceView.swift @@ -413,7 +413,9 @@ extension Ghostty { .cornerRadius(6) .focused($isSearchFieldFocused) .onExitCommand { + #if canImport(AppKit) Ghostty.moveFocus(to: surfaceView) + #endif } .backport.onKeyPress(.return) { modifiers in guard let surface = surfaceView.surface else { return .ignored } diff --git a/macos/Sources/Ghostty/SurfaceView_UIKit.swift b/macos/Sources/Ghostty/SurfaceView_UIKit.swift index 29364d4a5..09c41c0b5 100644 --- a/macos/Sources/Ghostty/SurfaceView_UIKit.swift +++ b/macos/Sources/Ghostty/SurfaceView_UIKit.swift @@ -40,6 +40,9 @@ extension Ghostty { /// True when the bell is active. This is set inactive on focus or event. @Published var bell: Bool = false + + // The current search state. When non-nil, the search overlay should be shown. + @Published var searchState: SearchState? = nil // Returns sizing information for the surface. This is the raw C // structure because I'm lazy.