Skip to content

Commit 6fc8217

Browse files
committed
Carry value over to new search
1 parent 61cf9c4 commit 6fc8217

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
818818
this._linkManager.openRecentLink(type);
819819
}
820820

821-
async runRecent(type: 'command' | 'cwd', filterMode?: 'fuzzy' | 'contiguous'): Promise<void> {
821+
async runRecent(type: 'command' | 'cwd', filterMode?: 'fuzzy' | 'contiguous', value?: string): Promise<void> {
822822
if (!this.xterm) {
823823
return;
824824
}
@@ -969,14 +969,13 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
969969
quickPick.items = [...originalItems];
970970
quickPick.sortByLabel = false;
971971
quickPick.placeholder = placeholder;
972-
quickPick.title = 'Run Recent Command';
973972
quickPick.customButton = true;
974973
quickPick.matchOnLabel = filterMode === 'fuzzy';
975974
if (filterMode === 'fuzzy') {
976975
quickPick.customLabel = nls.localize('terminal.contiguousSearch', 'Use Contiguous Search');
977976
quickPick.onDidCustom(() => {
978977
quickPick.hide();
979-
this.runRecent(type, 'contiguous');
978+
this.runRecent(type, 'contiguous', quickPick.value);
980979
});
981980
} else {
982981
// contiguous is the default for command
@@ -999,7 +998,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
999998
quickPick.customLabel = nls.localize('terminal.fuzzySearch', 'Use Fuzzy Search');
1000999
quickPick.onDidCustom(() => {
10011000
quickPick.hide();
1002-
this.runRecent(type, 'fuzzy');
1001+
this.runRecent(type, 'fuzzy', quickPick.value);
10031002
});
10041003
}
10051004
quickPick.onDidTriggerItemButton(async e => {
@@ -1034,6 +1033,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
10341033
this.sendText(type === 'cwd' ? `cd ${result.label}` : result.label, !quickPick.keyMods.alt);
10351034
quickPick.hide();
10361035
});
1036+
if (value) {
1037+
quickPick.value = value;
1038+
}
10371039
return new Promise<void>(r => {
10381040
quickPick.show();
10391041
quickPick.onDidHide(() => r());

0 commit comments

Comments
 (0)