Strip codicons from terminal quickpick filter matching#313197
Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
Open
Strip codicons from terminal quickpick filter matching#313197yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
Conversation
The terminal quick access provider built labels like \`$(icon-id) 1: Title\` and ran matchesFuzzy directly against the full string, so typing letters that happened to appear inside the codicon syntax (e.g. searching for \"err\" while a terminal had a \`$(error)\` icon) highlighted into the icon source. Use matchesFuzzyIconAware + parseLabelWithIcons instead, which is the helper the base quickInputList already uses for its own icon-aware matching. parseLabelWithIcons strips the icon syntax for matching while returning offsets remapped back to the original label, so highlights land on the visible text. Fixes microsoft#153829
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes terminal quick access (the term quickpick) fuzzy-filter highlighting so it doesn’t match/highlight inside codicon markup ($(icon-id)), aligning terminal quick access matching behavior with the base QuickPick list.
Changes:
- Replace raw
matchesFuzzymatching on the label with icon-aware matching viamatchesFuzzyIconAware. - Use
parseLabelWithIconsto strip codicon syntax for matching while remapping highlight offsets back onto the original label.
meganrogge
approved these changes
May 7, 2026
bpasero
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Typing in the terminal quickpick (`term` prefix) filter could highlight inside the `$(icon-id)` codicon syntax of each item's label, instead of only matching against the visible text.
Root cause
`terminalQuickAccess.ts` built each label as ```````````````` and ran `matchesFuzzy(filter, label, true)` against the entire string. The fuzzy match included the literal `$(...)` codicon prefix, so a query like `err` would highlight inside an `$(error)` icon.
Fix
Use the icon-aware helpers `matchesFuzzyIconAware` + `parseLabelWithIcons` from `base/common/iconLabels.ts` — the same pair that the base `quickInputList` already uses for its own matching. `parseLabelWithIcons` strips the icon syntax for matching while returning offsets remapped back to the original label so highlights land on the visible text.
cc @TylerLeonhardt — your comment in #153829 pointed at this exact pattern ("You probably wanna do what we do in the quick pick base"). Two-line change in `terminalQuickAccess.ts`.
Test plan
Fixes #153829