@@ -53,33 +53,32 @@ export class ExtHostTerminalShellIntegration extends Disposable implements IExtH
53
53
this . _activeShellIntegrations . clear ( ) ;
54
54
} ) ) ;
55
55
56
- // TODO: Remove test code
57
- this . onDidChangeTerminalShellIntegration ( e => {
58
- console . log ( '*** onDidChangeTerminalShellIntegration' , e ) ;
59
- } ) ;
60
- this . onDidStartTerminalShellExecution ( async e => {
61
- console . log ( '*** onDidStartTerminalShellExecution' , e ) ;
62
- // new Promise<void>(r => {
63
- // (async () => {
64
- // for await (const d of e.createDataStream()) {
65
- // console.log('data2', d);
66
- // }
67
- // })();
68
- // });
69
- for await ( const d of e . createDataStream ( ) ) {
70
- console . log ( 'data' , d ) ;
71
- }
72
- } ) ;
73
- this . onDidEndTerminalShellExecution ( e => {
74
- console . log ( '*** onDidEndTerminalShellExecution' , e ) ;
75
- } ) ;
76
-
77
- setTimeout ( ( ) => {
78
- Array . from ( this . _activeShellIntegrations . values ( ) ) [ 0 ] . value . executeCommand ( 'echo hello' ) ;
79
- } , 4000 ) ;
56
+ // Convenient test code:
57
+ // this.onDidChangeTerminalShellIntegration(e => {
58
+ // console.log('*** onDidChangeTerminalShellIntegration', e);
59
+ // });
60
+ // this.onDidStartTerminalShellExecution(async e => {
61
+ // console.log('*** onDidStartTerminalShellExecution', e);
62
+ // // new Promise<void>(r => {
63
+ // // (async () => {
64
+ // // for await (const d of e.createDataStream()) {
65
+ // // console.log('data2', d);
66
+ // // }
67
+ // // })();
68
+ // // });
69
+ // for await (const d of e.createDataStream()) {
70
+ // console.log('data', d);
71
+ // }
72
+ // });
73
+ // this.onDidEndTerminalShellExecution(e => {
74
+ // console.log('*** onDidEndTerminalShellExecution', e);
75
+ // });
76
+ // setTimeout(() => {
77
+ // Array.from(this._activeShellIntegrations.values())[0].value.executeCommand('echo hello');
78
+ // }, 4000);
80
79
}
81
80
82
- public $acceptDidChangeShellIntegration ( instanceId : number ) : void {
81
+ public $shellIntegrationChange ( instanceId : number ) : void {
83
82
const terminal = this . _extHostTerminalService . getTerminalById ( instanceId ) ;
84
83
if ( ! terminal ) {
85
84
return ;
@@ -104,28 +103,28 @@ export class ExtHostTerminalShellIntegration extends Disposable implements IExtH
104
103
} ) ;
105
104
}
106
105
107
- public $acceptTerminalShellExecutionStart ( instanceId : number , commandLine : string , cwd : URI | string | undefined ) : void {
106
+ public $shellExecutionStart ( instanceId : number , commandLine : string , cwd : URI | string | undefined ) : void {
108
107
// Force shellIntegration creation if it hasn't been created yet, this could when events
109
108
// don't come through on startup
110
109
if ( ! this . _activeShellIntegrations . has ( instanceId ) ) {
111
- this . $acceptDidChangeShellIntegration ( instanceId ) ;
110
+ this . $shellIntegrationChange ( instanceId ) ;
112
111
}
113
112
this . _activeShellIntegrations . get ( instanceId ) ?. startShellExecution ( commandLine , cwd ) ;
114
113
}
115
114
116
- public $acceptTerminalShellExecutionEnd ( instanceId : number , commandLine : string | undefined , exitCode : number | undefined ) : void {
115
+ public $shellExecutionEnd ( instanceId : number , commandLine : string | undefined , exitCode : number | undefined ) : void {
117
116
this . _activeShellIntegrations . get ( instanceId ) ?. endShellExecution ( commandLine , exitCode ) ;
118
117
}
119
118
120
- public $acceptTerminalShellExecutionData ( instanceId : number , data : string ) : void {
119
+ public $shellExecutionData ( instanceId : number , data : string ) : void {
121
120
this . _activeShellIntegrations . get ( instanceId ) ?. emitData ( data ) ;
122
121
}
123
122
124
- public $acceptTerminalCwdChange ( instanceId : number , cwd : string ) : void {
123
+ public $cwdChange ( instanceId : number , cwd : string ) : void {
125
124
this . _activeShellIntegrations . get ( instanceId ) ?. setCwd ( cwd ) ;
126
125
}
127
126
128
- public $acceptCloseTerminal ( instanceId : number ) : void {
127
+ public $closeTerminal ( instanceId : number ) : void {
129
128
this . _activeShellIntegrations . get ( instanceId ) ?. dispose ( ) ;
130
129
this . _activeShellIntegrations . delete ( instanceId ) ;
131
130
0 commit comments