From 7a346dd8d40e21b14c96114c45f75eb0d347c236 Mon Sep 17 00:00:00 2001 From: minorcell Date: Sat, 23 May 2026 00:08:34 +0800 Subject: [PATCH 1/2] macOS: fix search bar Enter key blocking IME composition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use onSubmit for the plain Enter → next-match behavior, which respects IME composition state. Keep onKeyPress only for Shift+Enter (previous match), returning .ignored for plain Enter so the IME can process it. --- macos/Sources/Ghostty/Surface View/SurfaceView.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView.swift b/macos/Sources/Ghostty/Surface View/SurfaceView.swift index 825927323..67862391c 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView.swift @@ -417,6 +417,10 @@ extension Ghostty { // to our synced needle. searchState.readPasteboardNeedle() } + .onSubmit { + _ = surfaceView.navigateSearchToNext() + } + } #if canImport(AppKit) .onExitCommand { if searchState.needle.isEmpty { @@ -429,10 +433,9 @@ extension Ghostty { .backport.onKeyPress(.return) { modifiers in if modifiers.contains(.shift) { _ = surfaceView.navigateSearchToPrevious() - } else { - _ = surfaceView.navigateSearchToNext() + return .handled } - return .handled + return .ignored } Button(action: { From da541bea6333458c5f4a987e734269e019a2103d Mon Sep 17 00:00:00 2001 From: minorcell Date: Sat, 23 May 2026 16:33:33 +0800 Subject: [PATCH 2/2] fix stray brace from conflict resolution --- macos/Sources/Ghostty/Surface View/SurfaceView.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView.swift b/macos/Sources/Ghostty/Surface View/SurfaceView.swift index 67862391c..f6b30a7ad 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView.swift @@ -420,7 +420,6 @@ extension Ghostty { .onSubmit { _ = surfaceView.navigateSearchToNext() } - } #if canImport(AppKit) .onExitCommand { if searchState.needle.isEmpty {