5
5
6
6
import { Event } from 'vs/base/common/event' ;
7
7
import { Disposable } from 'vs/base/common/lifecycle' ;
8
+ import { IProductService } from 'vs/platform/product/common/productService' ;
8
9
import { TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities' ;
9
10
import { ExtHostContext , MainContext , type ExtHostTerminalShellIntegrationShape , type MainThreadTerminalShellIntegrationShape } from 'vs/workbench/api/common/extHost.protocol' ;
10
11
import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal' ;
@@ -16,7 +17,8 @@ export class MainThreadTerminalShellIntegration extends Disposable implements Ma
16
17
17
18
constructor (
18
19
extHostContext : IExtHostContext ,
19
- @ITerminalService private readonly _terminalService : ITerminalService
20
+ @ITerminalService private readonly _terminalService : ITerminalService ,
21
+ @IProductService productService : IProductService
20
22
) {
21
23
super ( ) ;
22
24
@@ -47,10 +49,13 @@ export class MainThreadTerminalShellIntegration extends Disposable implements Ma
47
49
// Clean up after dispose
48
50
this . _store . add ( this . _terminalService . onDidDisposeInstance ( e => this . _proxy . $closeTerminal ( e . instanceId ) ) ) ;
49
51
50
- // TODO: Only do this if there is a consumer
51
- // TODO: This needs to go via the server on remote for performance reasons
52
- // TerminalShellExecution.dataStream
53
- this . _store . add ( this . _terminalService . onAnyInstanceData ( e => this . _proxy . $shellExecutionData ( e . instance . instanceId , e . data ) ) ) ;
52
+ // TerminalShellExecution.createDataStream
53
+ // HACK: While proposed, this will only work in Insiders so as to not hurt performance in
54
+ // stable
55
+ if ( productService . quality === 'insiders' ) {
56
+ // TODO: This should to go via the server on remote
57
+ this . _store . add ( this . _terminalService . onAnyInstanceData ( e => this . _proxy . $shellExecutionData ( e . instance . instanceId , e . data ) ) ) ;
58
+ }
54
59
}
55
60
56
61
$executeCommand ( terminalId : number , commandLine : string ) : void {
0 commit comments