macos: esc returns focus back to surface

pull/9709/head
Mitchell Hashimoto 2025-11-25 12:20:01 -08:00
parent b7e70ce534
commit c61d28a3a4
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 5 additions and 1 deletions

View File

@ -200,7 +200,7 @@ extension Ghostty {
// Search overlay
if surfaceView.searchState != nil {
SurfaceSearchOverlay(searchState: $surfaceView.searchState)
SurfaceSearchOverlay(surfaceView: surfaceView, searchState: $surfaceView.searchState)
}
// Show bell border if enabled
@ -389,6 +389,7 @@ extension Ghostty {
/// Search overlay view that displays a search bar with input field and navigation buttons.
struct SurfaceSearchOverlay: View {
let surfaceView: SurfaceView
@Binding var searchState: SurfaceView.SearchState?
@State private var searchText: String = ""
@State private var corner: Corner = .topRight
@ -409,6 +410,9 @@ extension Ghostty {
.background(Color.primary.opacity(0.1))
.cornerRadius(6)
.focused($isSearchFieldFocused)
.onExitCommand {
Ghostty.moveFocus(to: surfaceView)
}
Button(action: {}) {
Image(systemName: "chevron.up")