@@ -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 (
@@ -797,16 +799,21 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
797
799
query : `terminal-output-${ selectedCommand . timestamp } -${ this . instanceId } `
798
800
} ) ) ;
799
801
if ( textContent ) {
800
- this . _editorService . openEditor ( {
802
+ await this . _editorService . openEditor ( {
801
803
resource : textContent . uri
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