macos: clean up menu

This commit is contained in:
Mitchell Hashimoto
2026-01-06 14:20:30 -08:00
parent f07d600e43
commit 05a41c7772
3 changed files with 7 additions and 14 deletions

View File

@@ -263,12 +263,6 @@
<action selector="find:" target="-1" id="PeY-3u-IxC"/>
</connections>
</menuItem>
<menuItem title="Selection for Find" id="TDN-42-Bu7">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="selectionForFind:" target="-1" id="rhL-7g-XQQ"/>
</connections>
</menuItem>
<menuItem title="Find Next" id="XqU-X8-q32">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
@@ -288,6 +282,13 @@
<action selector="findHide:" target="-1" id="hGP-K9-yN9"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="2N8-Xz-RVc"/>
<menuItem title="Use Selection for Find" id="TDN-42-Bu7">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="selectionForFind:" target="-1" id="rhL-7g-XQQ"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>

View File

@@ -406,7 +406,6 @@ extension Notification.Name {
/// Focus the search field
static let ghosttySearchFocus = Notification.Name("com.mitchellh.ghostty.searchFocus")
static let ghosttySelectionForSearch = Notification.Name("com.mitchellh.ghostty.selectionForSearch")
}
// NOTE: I am moving all of these to Notification.Name extensions over time. This

View File

@@ -479,13 +479,6 @@ extension Ghostty {
isSearchFieldFocused = true
}
}
.onReceive(NotificationCenter.default.publisher(for: .ghosttySelectionForSearch)) { notification in
guard notification.object as? SurfaceView === surfaceView else { return }
if let userInfo = notification.userInfo, let text = userInfo["text"] as? String {
searchState.needle = text
// We do not focus the textfield after the action to match macOS behavior
}
}
.background(
GeometryReader { barGeo in
Color.clear.onAppear {