@@ -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 , TerminalLocation , TitleEventSource } from 'vs/platform/terminal/common/terminal' ;
13
+ import { IProcessProperty , IShellLaunchConfig , IShellLaunchConfigDto , ProcessPropertyType , 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,18 +303,6 @@ 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
-
318
306
public $sendProcessData ( terminalId : number , data : string ) : void {
319
307
this . _terminalProcessProxies . get ( terminalId ) ?. emitData ( data ) ;
320
308
}
@@ -324,13 +312,15 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
324
312
}
325
313
326
314
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
+ }
327
321
this . _terminalProcessProxies . get ( terminalId ) ?. emitProcessProperty ( property ) ;
328
322
}
329
323
330
- public $sendProcessExit ( terminalId : number , exitCode : number | undefined ) : void {
331
- this . _terminalProcessProxies . get ( terminalId ) ?. emitExit ( exitCode ) ;
332
- }
333
-
334
324
private async _onRequestLatency ( terminalId : number ) : Promise < void > {
335
325
const COUNT = 2 ;
336
326
let sum = 0 ;
0 commit comments