@@ -43,7 +43,7 @@ import { ExtensionScanner, ExtensionScannerInput } from 'vs/workbench/services/e
43
43
class Watcher extends DiskFileSystemProvider {
44
44
public readonly watches = new Map < number , IDisposable > ( ) ;
45
45
46
- public dispose ( ) : void {
46
+ public override dispose ( ) : void {
47
47
this . watches . forEach ( ( w ) => w . dispose ( ) ) ;
48
48
this . watches . clear ( ) ;
49
49
super . dispose ( ) ;
@@ -263,6 +263,7 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
263
263
globalStorageHome : this . environment . globalStorageHome ,
264
264
workspaceStorageHome : this . environment . workspaceStorageHome ,
265
265
userHome : this . environment . userHome ,
266
+ useHostProxy : false ,
266
267
os : platform . OS ,
267
268
marks : [ ]
268
269
} ;
@@ -382,7 +383,7 @@ class VariableResolverService extends AbstractVariableResolverService {
382
383
getLineNumber : ( ) : string | undefined => {
383
384
return args . resolvedVariables . selectedText ;
384
385
} ,
385
- } , undefined , env ) ;
386
+ } , undefined , Promise . resolve ( env ) ) ;
386
387
}
387
388
}
388
389
@@ -442,6 +443,7 @@ class Terminal extends TerminalProcess {
442
443
workspaceId : this . workspaceId ,
443
444
workspaceName : this . workspaceName ,
444
445
isOrphan : this . isOrphan ,
446
+ icon : 'bash' // TODO@oxy : used for icon, but not sure how to resolve it
445
447
} ;
446
448
}
447
449
}
@@ -472,8 +474,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
472
474
473
475
// Buffer to reduce the number of messages going to the renderer.
474
476
private readonly bufferer = new TerminalDataBufferer ( ( id , data ) => {
475
- // TODO: Not sure what sync means.
476
- this . _onProcessData . fire ( { id, event : { data, sync : true } } ) ;
477
+ this . _onProcessData . fire ( { id, event : data } ) ;
477
478
} ) ;
478
479
479
480
public constructor ( private readonly logService : ILogService ) { }
@@ -514,7 +515,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
514
515
switch ( command ) {
515
516
case '$restartPtyHost' : return this . restartPtyHost ( ) ;
516
517
case '$createProcess' : return this . createProcess ( context . remoteAuthority , args ) ;
517
- case '$attachProcess ' : return this . attachProcess ( args [ 0 ] ) ;
518
+ case '$attachToProcess ' : return this . attachToProcess ( args [ 0 ] ) ;
518
519
case '$start' : return this . start ( args [ 0 ] ) ;
519
520
case '$input' : return this . input ( args [ 0 ] , args [ 1 ] ) ;
520
521
case '$acknowledgeDataEvent' : return this . acknowledgeDataEvent ( args [ 0 ] , args [ 1 ] ) ;
@@ -524,9 +525,12 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
524
525
case '$getCwd' : return this . getCwd ( args [ 0 ] ) ;
525
526
case '$sendCommandResult' : return this . sendCommandResult ( args [ 0 ] , args [ 1 ] , args [ 2 ] , args [ 3 ] ) ;
526
527
case '$orphanQuestionReply' : return this . orphanQuestionReply ( args [ 0 ] ) ;
527
- case '$listProcesses' : return this . listProcesses ( args [ 0 ] ) ;
528
+ case '$listProcesses' : return this . listProcesses ( ) ;
528
529
case '$setTerminalLayoutInfo' : return this . setTerminalLayoutInfo ( args ) ;
529
530
case '$getTerminalLayoutInfo' : return this . getTerminalLayoutInfo ( args ) ;
531
+ case '$getShellEnvironment' : return this . getShellEnvironment ( ) ;
532
+ case '$getDefaultSystemShell' : return this . getDefaultSystemShell ( args [ 0 ] ) ;
533
+ case '$reduceConnectionGraceTime' : return this . reduceConnectionGraceTime ( ) ;
530
534
}
531
535
532
536
throw new Error ( `Invalid call '${ command } '` ) ;
@@ -564,27 +568,26 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
564
568
toResource : ( relativePath : string ) => resources . joinPath ( activeWorkspaceUri , relativePath ) ,
565
569
} : undefined ;
566
570
567
- const resolverService = new VariableResolverService ( remoteAuthority , args , process . env as platform . IProcessEnvironment ) ;
568
- const resolver = terminalEnvironment . createVariableResolver ( activeWorkspace , resolverService ) ;
571
+ const resolverService = new VariableResolverService ( remoteAuthority , args , process . env ) ;
572
+ const resolver = terminalEnvironment . createVariableResolver ( activeWorkspace , process . env , resolverService ) ;
569
573
570
574
const getDefaultShellAndArgs = async ( ) : Promise < { executable : string ; args : string [ ] | string } > => {
571
575
if ( shellLaunchConfig . executable ) {
572
- const executable = resolverService . resolve ( activeWorkspace , shellLaunchConfig . executable ) ;
576
+ const executable = await resolverService . resolveAsync ( activeWorkspace , shellLaunchConfig . executable ) ;
573
577
let resolvedArgs : string [ ] | string = [ ] ;
574
578
if ( shellLaunchConfig . args && Array . isArray ( shellLaunchConfig . args ) ) {
575
579
for ( const arg of shellLaunchConfig . args ) {
576
- resolvedArgs . push ( resolverService . resolve ( activeWorkspace , arg ) ) ;
580
+ resolvedArgs . push ( await resolverService . resolveAsync ( activeWorkspace , arg ) ) ;
577
581
}
578
582
} else if ( shellLaunchConfig . args ) {
579
- resolvedArgs = resolverService . resolve ( activeWorkspace , shellLaunchConfig . args ) ;
583
+ resolvedArgs = await resolverService . resolveAsync ( activeWorkspace , shellLaunchConfig . args ) ;
580
584
}
581
585
return { executable, args : resolvedArgs } ;
582
586
}
583
587
584
588
const executable = terminalEnvironment . getDefaultShell (
585
589
( key ) => args . configuration [ key ] ,
586
- args . isWorkspaceShellAllowed ,
587
- await getSystemShell ( platform . platform , process . env as platform . IProcessEnvironment ) ,
590
+ await getSystemShell ( platform . OS , process . env as platform . IProcessEnvironment ) ,
588
591
process . env . hasOwnProperty ( 'PROCESSOR_ARCHITEW6432' ) ,
589
592
process . env . windir ,
590
593
resolver ,
@@ -594,7 +597,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
594
597
595
598
const resolvedArgs = terminalEnvironment . getDefaultShellArgs (
596
599
( key ) => args . configuration [ key ] ,
597
- args . isWorkspaceShellAllowed ,
598
600
false , // useAutomationShell
599
601
resolver ,
600
602
this . logService ,
@@ -625,7 +627,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
625
627
logger . debug ( 'Resolved shell launch configuration' , field ( 'id' , terminalId ) ) ;
626
628
627
629
// Use instead of `terminal.integrated.env.${platform}` to make types work.
628
- const getEnvFromConfig = ( ) : terminal . ISingleTerminalConfiguration < ITerminalEnvironment > => {
630
+ const getEnvFromConfig = ( ) : ITerminalEnvironment => {
629
631
if ( platform . isWindows ) {
630
632
return args . configuration [ 'terminal.integrated.env.windows' ] ;
631
633
} else if ( platform . isMacintosh ) {
@@ -635,7 +637,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
635
637
} ;
636
638
637
639
const getNonInheritedEnv = async ( ) : Promise < platform . IProcessEnvironment > => {
638
- const env = await getMainProcessParentEnv ( ) ;
640
+ const env = await getMainProcessParentEnv ( process . env ) ;
639
641
env . VSCODE_IPC_HOOK_CLI = process . env [ 'VSCODE_IPC_HOOK_CLI' ] ! ;
640
642
return env ;
641
643
} ;
@@ -644,7 +646,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
644
646
shellLaunchConfig ,
645
647
getEnvFromConfig ( ) ,
646
648
resolver ,
647
- args . isWorkspaceShellAllowed ,
648
649
product . version ,
649
650
args . configuration [ 'terminal.integrated.detectLocale' ] ,
650
651
args . configuration [ 'terminal.integrated.inheritEnv' ] !== false
@@ -700,7 +701,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
700
701
return terminal ;
701
702
}
702
703
703
- private async attachProcess ( _id : number ) : Promise < void > {
704
+ private async attachToProcess ( _id : number ) : Promise < void > {
704
705
// TODO: Won't be necessary until we have persistent terminals.
705
706
throw new Error ( 'not implemented' ) ;
706
707
}
@@ -743,8 +744,14 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
743
744
throw new Error ( 'not implemented' ) ;
744
745
}
745
746
746
- private async listProcesses ( _reduceGraceTime : boolean ) : Promise < IProcessDetails [ ] > {
747
- // TODO: reduceGraceTime.
747
+ private async reduceConnectionGraceTime ( ) : Promise < void > {
748
+ // NOTE: Not required unless we implement orphan terminals, see above.
749
+ // Returning instead of throwing error as VSCode expects this function
750
+ // to always succeed and throwing an error causes the terminal to crash.
751
+ return ;
752
+ }
753
+
754
+ private async listProcesses ( ) : Promise < IProcessDetails [ ] > {
748
755
const terminals = await Promise . all ( Array . from ( this . terminals ) . map ( async ( [ id , terminal ] ) => {
749
756
return terminal . description ( id ) ;
750
757
} ) ) ;
@@ -786,6 +793,14 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
786
793
787
794
return { tabs } ;
788
795
}
796
+
797
+ async getShellEnvironment ( ) : Promise < platform . IProcessEnvironment > {
798
+ return { ...process . env } ;
799
+ }
800
+
801
+ async getDefaultSystemShell ( osOverride : platform . OperatingSystem = platform . OS ) : Promise < string > {
802
+ return getSystemShell ( osOverride , process . env ) ;
803
+ }
789
804
}
790
805
791
806
function transformIncoming ( remoteAuthority : string , uri : UriComponents | undefined ) : URI | undefined {
0 commit comments