macOS: fix search bar Enter key blocking IME composition

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.
This commit is contained in:
minorcell
2026-05-23 00:08:34 +08:00
parent a968e120dd
commit 7a346dd8d4

View File

@@ -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: {