Fuzzy search in command palette #10510
Replies: 3 comments 2 replies
-
|
The part you linked for linux has nothing to do with command palette at all that is the search overlay with ctrl+f |
Beta Was this translation helpful? Give feedback.
-
|
I think that having a fuzzy search in the command palette would be great. I attempted such a thing in the past for GTK but I had something wrong and got segfaults so I moved on to other things and abandoned it. Note that we already have a fuzzy search library ( @rhodes-b is correct that you're looking at the wrong part of the source code, the filtering for the command palette is done elsewhere. I'd also recommend not trying to do both platforms at once. Do one, get the PR accepted, and then do the other. Also, if you can't personally test your changes on a platform don't even try to vibe code your way through it. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah this is something that's always been planned. My first iteration of the command palette actually had zf-based fuzzy search but it got cut to save time and energy for the reviewers. Now that the feature has matured a bit I think it's time to revisit that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue: command palette doesn't do basic text fuzzy searching
Hitting cmd+P and typing in "foc spl" should give me Focus Split options, but shows nothing.
I'm willing to submit a PR (well-crafted and tested) if it is desirable behavior.
Preliminary research
Initial review shows that these functions seem to do the searching:
macOS:
ghostty/macos/Sources/Features/Command Palette/CommandPalette.swift
Lines 71 to 89 in d8b1b09
Linux:My current assumption is that I could change these functions to do a fuzzy ordered string match, and it would solve this problem. If this is desirable, I'll do a pass at implementation.
EDIT: Linux would need to be custom GTK filtering utilizing
zf(per jcollie's answer below).Beta Was this translation helpful? Give feedback.
All reactions