@@ -766,7 +766,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
766
766
const buttons : IQuickInputButton [ ] = [ {
767
767
iconClass,
768
768
tooltip : nls . localize ( 'viewCommandOutput' , "View Command Output" ) ,
769
- alwaysVisible : true
769
+ alwaysVisible : true ,
770
770
} ] ;
771
771
items . push ( {
772
772
label,
@@ -784,9 +784,11 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
784
784
}
785
785
}
786
786
const outputProvider = this . _instantiationService . createInstance ( TerminalOutputProvider ) ;
787
- const result = await this . _quickInputService . pick ( items . reverse ( ) , {
788
- onDidTriggerItemButton : ( async e => {
789
- const selectedCommand = e . item . command ;
787
+ const quickPick = this . _quickInputService . createQuickPick ( ) ;
788
+ quickPick . items = items . reverse ( ) ;
789
+ return new Promise < void > ( r => {
790
+ quickPick . onDidTriggerItemButton ( async e => {
791
+ const selectedCommand = ( e . item as Item ) . command ;
790
792
const output = selectedCommand ?. getOutput ( ) ;
791
793
if ( output && selectedCommand ?. command ) {
792
794
const textContent = await outputProvider . provideTextContent ( URI . from (
@@ -802,11 +804,16 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
802
804
} ) ;
803
805
}
804
806
}
805
- } )
807
+ quickPick . hide ( ) ;
808
+ } ) ;
809
+ quickPick . onDidAccept ( e => {
810
+ const result = quickPick . activeItems [ 0 ] ;
811
+ this . sendText ( type === 'cwd' ? `cd ${ result . label } ` : result . label , true ) ;
812
+ quickPick . hide ( ) ;
813
+ } ) ;
814
+ quickPick . show ( ) ;
815
+ quickPick . onDidHide ( ( ) => r ( ) ) ;
806
816
} ) ;
807
- if ( result ) {
808
- this . sendText ( type === 'cwd' ? `cd ${ result . label } ` : result . label , true ) ;
809
- }
810
817
}
811
818
812
819
detachFromElement ( ) : void {
0 commit comments