@@ -10,7 +10,7 @@ import { URI } from 'vs/base/common/uri';
10
10
import { StopWatch } from 'vs/base/common/stopwatch' ;
11
11
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
12
12
import { ILogService } from 'vs/platform/log/common/log' ;
13
- import { IProcessProperty , IShellLaunchConfig , IShellLaunchConfigDto , ProcessPropertyType , TerminalLocation , TitleEventSource } from 'vs/platform/terminal/common/terminal' ;
13
+ import { IProcessProperty , IShellLaunchConfig , IShellLaunchConfigDto , TerminalLocation , TitleEventSource } from 'vs/platform/terminal/common/terminal' ;
14
14
import { TerminalDataBufferer } from 'vs/platform/terminal/common/terminalDataBuffering' ;
15
15
import { ITerminalEditorService , ITerminalExternalLinkProvider , ITerminalGroupService , ITerminalInstance , ITerminalInstanceService , ITerminalLink , ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal' ;
16
16
import { TerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy' ;
@@ -303,6 +303,18 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
303
303
proxy . onRequestLatency ( ( ) => this . _onRequestLatency ( proxy . instanceId ) ) ;
304
304
}
305
305
306
+ public $sendProcessTitle ( terminalId : number , title : string ) : void {
307
+ // Since title events can only come from vscode.Pseudoterminals right now, these are routed
308
+ // directly to the instance as API source events such that they will replace the initial
309
+ // `name` property provided for the Pseudoterminal. If we support showing both Api and
310
+ // Process titles at the same time we may want to pass this through as a Process source
311
+ // event.
312
+ const instance = this . _terminalService . getInstanceFromId ( terminalId ) ;
313
+ if ( instance ) {
314
+ instance . refreshTabLabels ( title , TitleEventSource . Api ) ;
315
+ }
316
+ }
317
+
306
318
public $sendProcessData ( terminalId : number , data : string ) : void {
307
319
this . _terminalProcessProxies . get ( terminalId ) ?. emitData ( data ) ;
308
320
}
@@ -312,15 +324,13 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
312
324
}
313
325
314
326
public $sendProcessProperty ( terminalId : number , property : IProcessProperty < any > ) : void {
315
- if ( property . type === ProcessPropertyType . Title ) {
316
- const instance = this . _terminalService . getInstanceFromId ( terminalId ) ;
317
- if ( instance ) {
318
- instance . refreshTabLabels ( property . value , TitleEventSource . Api ) ;
319
- }
320
- }
321
327
this . _terminalProcessProxies . get ( terminalId ) ?. emitProcessProperty ( property ) ;
322
328
}
323
329
330
+ public $sendProcessExit ( terminalId : number , exitCode : number | undefined ) : void {
331
+ this . _terminalProcessProxies . get ( terminalId ) ?. emitExit ( exitCode ) ;
332
+ }
333
+
324
334
private async _onRequestLatency ( terminalId : number ) : Promise < void > {
325
335
const COUNT = 2 ;
326
336
let sum = 0 ;
0 commit comments