@@ -48,7 +48,7 @@ import { ITerminalCommand, TerminalCapability } from 'vs/platform/terminal/commo
48
48
import { TerminalCapabilityStoreMultiplexer } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore' ;
49
49
import { IProcessDataEvent , IProcessPropertyMap , IReconnectionProperties , IShellLaunchConfig , ITerminalDimensionsOverride , ITerminalLaunchError , PosixShellType , ProcessPropertyType , ShellIntegrationStatus , TerminalExitReason , TerminalIcon , TerminalLocation , TerminalSettingId , TerminalShellType , TitleEventSource , WindowsShellType } from 'vs/platform/terminal/common/terminal' ;
50
50
import { escapeNonWindowsPath , collapseTildePath } from 'vs/platform/terminal/common/terminalEnvironment' ;
51
- import { activeContrastBorder , scrollbarSliderActiveBackground , scrollbarSliderBackground , scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry' ;
51
+ import { activeContrastBorder , inputActiveOptionBackground , inputActiveOptionBorder , inputActiveOptionForeground , scrollbarSliderActiveBackground , scrollbarSliderBackground , scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry' ;
52
52
import { IColorTheme , ICssStyleCollector , IThemeService , registerThemingParticipant , ThemeIcon } from 'vs/platform/theme/common/themeService' ;
53
53
import { IWorkspaceContextService , IWorkspaceFolder } from 'vs/platform/workspace/common/workspace' ;
54
54
import { IWorkspaceTrustRequestService } from 'vs/platform/workspace/common/workspaceTrust' ;
@@ -90,6 +90,7 @@ import { getIconRegistry } from 'vs/platform/theme/common/iconRegistry';
90
90
import { TaskSettingId } from 'vs/workbench/contrib/tasks/common/tasks' ;
91
91
import { TerminalStorageKeys } from 'vs/workbench/contrib/terminal/common/terminalStorageKeys' ;
92
92
import { showWithPinnedItems } from 'vs/platform/quickinput/browser/quickPickPin' ;
93
+ import { Toggle } from 'vs/base/browser/ui/toggle/toggle' ;
93
94
94
95
const enum Constants {
95
96
/**
@@ -1010,27 +1011,32 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
1010
1011
if ( items . length === 0 ) {
1011
1012
return ;
1012
1013
}
1014
+ // TODO: Toggling fuzzy shows pinned again
1015
+ const fuzzySearchToggle = new Toggle ( {
1016
+ title : 'Fuzzy search' ,
1017
+ icon : Codicon . searchFuzzy ,
1018
+ isChecked : filterMode === 'fuzzy' ,
1019
+ inputActiveOptionBorder : this . _themeService . getColorTheme ( ) . getColor ( inputActiveOptionBorder ) ,
1020
+ inputActiveOptionForeground : this . _themeService . getColorTheme ( ) . getColor ( inputActiveOptionForeground ) ,
1021
+ inputActiveOptionBackground : this . _themeService . getColorTheme ( ) . getColor ( inputActiveOptionBackground )
1022
+ } ) ;
1023
+ fuzzySearchToggle . onChange ( ( ) => {
1024
+ if ( fuzzySearchToggle . checked ) {
1025
+ quickPick . hide ( ) ;
1026
+ this . runRecent ( type , 'fuzzy' , quickPick . value ) ;
1027
+ } else {
1028
+ quickPick . hide ( ) ;
1029
+ this . runRecent ( type , 'contiguous' , quickPick . value ) ;
1030
+ }
1031
+ } ) ;
1013
1032
const outputProvider = this . _instantiationService . createInstance ( TerminalOutputProvider ) ;
1014
1033
const quickPick = this . _quickInputService . createQuickPick < IQuickPickItem & { rawLabel : string } > ( ) ;
1015
1034
const originalItems = items ;
1016
1035
quickPick . items = [ ...originalItems ] ;
1017
1036
quickPick . sortByLabel = false ;
1018
1037
quickPick . placeholder = placeholder ;
1019
- quickPick . customButton = true ;
1020
1038
quickPick . matchOnLabelMode = filterMode || 'contiguous' ;
1021
- if ( filterMode === 'fuzzy' ) {
1022
- quickPick . customLabel = nls . localize ( 'terminal.contiguousSearch' , 'Use Contiguous Search' ) ;
1023
- quickPick . onDidCustom ( ( ) => {
1024
- quickPick . hide ( ) ;
1025
- this . runRecent ( type , 'contiguous' , quickPick . value ) ;
1026
- } ) ;
1027
- } else {
1028
- quickPick . customLabel = nls . localize ( 'terminal.fuzzySearch' , 'Use Fuzzy Search' ) ;
1029
- quickPick . onDidCustom ( ( ) => {
1030
- quickPick . hide ( ) ;
1031
- this . runRecent ( type , 'fuzzy' , quickPick . value ) ;
1032
- } ) ;
1033
- }
1039
+ quickPick . additionalToggles = [ fuzzySearchToggle ] ;
1034
1040
quickPick . onDidTriggerItemButton ( async e => {
1035
1041
if ( e . button === removeFromCommandHistoryButton ) {
1036
1042
if ( type === 'command' ) {
0 commit comments