@@ -43,7 +43,7 @@ import { ExtensionScanner, ExtensionScannerInput } from 'vs/workbench/services/e
4343class Watcher extends DiskFileSystemProvider {
4444 public readonly watches = new Map < number , IDisposable > ( ) ;
4545
46- public dispose ( ) : void {
46+ public override dispose ( ) : void {
4747 this . watches . forEach ( ( w ) => w . dispose ( ) ) ;
4848 this . watches . clear ( ) ;
4949 super . dispose ( ) ;
@@ -263,6 +263,7 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
263263 globalStorageHome : this . environment . globalStorageHome ,
264264 workspaceStorageHome : this . environment . workspaceStorageHome ,
265265 userHome : this . environment . userHome ,
266+ useHostProxy : false ,
266267 os : platform . OS ,
267268 marks : [ ]
268269 } ;
@@ -382,7 +383,7 @@ class VariableResolverService extends AbstractVariableResolverService {
382383 getLineNumber : ( ) : string | undefined => {
383384 return args . resolvedVariables . selectedText ;
384385 } ,
385- } , undefined , env ) ;
386+ } , undefined , Promise . resolve ( env ) ) ;
386387 }
387388}
388389
@@ -442,6 +443,7 @@ class Terminal extends TerminalProcess {
442443 workspaceId : this . workspaceId ,
443444 workspaceName : this . workspaceName ,
444445 isOrphan : this . isOrphan ,
446+ icon : 'bash' // TODO@oxy : used for icon, but not sure how to resolve it
445447 } ;
446448 }
447449}
@@ -472,8 +474,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
472474
473475 // Buffer to reduce the number of messages going to the renderer.
474476 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 } ) ;
477478 } ) ;
478479
479480 public constructor ( private readonly logService : ILogService ) { }
@@ -514,7 +515,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
514515 switch ( command ) {
515516 case '$restartPtyHost' : return this . restartPtyHost ( ) ;
516517 case '$createProcess' : return this . createProcess ( context . remoteAuthority , args ) ;
517- case '$attachProcess ' : return this . attachProcess ( args [ 0 ] ) ;
518+ case '$attachToProcess ' : return this . attachToProcess ( args [ 0 ] ) ;
518519 case '$start' : return this . start ( args [ 0 ] ) ;
519520 case '$input' : return this . input ( args [ 0 ] , args [ 1 ] ) ;
520521 case '$acknowledgeDataEvent' : return this . acknowledgeDataEvent ( args [ 0 ] , args [ 1 ] ) ;
@@ -524,9 +525,12 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
524525 case '$getCwd' : return this . getCwd ( args [ 0 ] ) ;
525526 case '$sendCommandResult' : return this . sendCommandResult ( args [ 0 ] , args [ 1 ] , args [ 2 ] , args [ 3 ] ) ;
526527 case '$orphanQuestionReply' : return this . orphanQuestionReply ( args [ 0 ] ) ;
527- case '$listProcesses' : return this . listProcesses ( args [ 0 ] ) ;
528+ case '$listProcesses' : return this . listProcesses ( ) ;
528529 case '$setTerminalLayoutInfo' : return this . setTerminalLayoutInfo ( args ) ;
529530 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 ( ) ;
530534 }
531535
532536 throw new Error ( `Invalid call '${ command } '` ) ;
@@ -564,27 +568,26 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
564568 toResource : ( relativePath : string ) => resources . joinPath ( activeWorkspaceUri , relativePath ) ,
565569 } : undefined ;
566570
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 ) ;
569573
570574 const getDefaultShellAndArgs = async ( ) : Promise < { executable : string ; args : string [ ] | string } > => {
571575 if ( shellLaunchConfig . executable ) {
572- const executable = resolverService . resolve ( activeWorkspace , shellLaunchConfig . executable ) ;
576+ const executable = await resolverService . resolveAsync ( activeWorkspace , shellLaunchConfig . executable ) ;
573577 let resolvedArgs : string [ ] | string = [ ] ;
574578 if ( shellLaunchConfig . args && Array . isArray ( shellLaunchConfig . args ) ) {
575579 for ( const arg of shellLaunchConfig . args ) {
576- resolvedArgs . push ( resolverService . resolve ( activeWorkspace , arg ) ) ;
580+ resolvedArgs . push ( await resolverService . resolveAsync ( activeWorkspace , arg ) ) ;
577581 }
578582 } else if ( shellLaunchConfig . args ) {
579- resolvedArgs = resolverService . resolve ( activeWorkspace , shellLaunchConfig . args ) ;
583+ resolvedArgs = await resolverService . resolveAsync ( activeWorkspace , shellLaunchConfig . args ) ;
580584 }
581585 return { executable, args : resolvedArgs } ;
582586 }
583587
584588 const executable = terminalEnvironment . getDefaultShell (
585589 ( 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 ) ,
588591 process . env . hasOwnProperty ( 'PROCESSOR_ARCHITEW6432' ) ,
589592 process . env . windir ,
590593 resolver ,
@@ -594,7 +597,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
594597
595598 const resolvedArgs = terminalEnvironment . getDefaultShellArgs (
596599 ( key ) => args . configuration [ key ] ,
597- args . isWorkspaceShellAllowed ,
598600 false , // useAutomationShell
599601 resolver ,
600602 this . logService ,
@@ -625,7 +627,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
625627 logger . debug ( 'Resolved shell launch configuration' , field ( 'id' , terminalId ) ) ;
626628
627629 // Use instead of `terminal.integrated.env.${platform}` to make types work.
628- const getEnvFromConfig = ( ) : terminal . ISingleTerminalConfiguration < ITerminalEnvironment > => {
630+ const getEnvFromConfig = ( ) : ITerminalEnvironment => {
629631 if ( platform . isWindows ) {
630632 return args . configuration [ 'terminal.integrated.env.windows' ] ;
631633 } else if ( platform . isMacintosh ) {
@@ -635,7 +637,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
635637 } ;
636638
637639 const getNonInheritedEnv = async ( ) : Promise < platform . IProcessEnvironment > => {
638- const env = await getMainProcessParentEnv ( ) ;
640+ const env = await getMainProcessParentEnv ( process . env ) ;
639641 env . VSCODE_IPC_HOOK_CLI = process . env [ 'VSCODE_IPC_HOOK_CLI' ] ! ;
640642 return env ;
641643 } ;
@@ -644,7 +646,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
644646 shellLaunchConfig ,
645647 getEnvFromConfig ( ) ,
646648 resolver ,
647- args . isWorkspaceShellAllowed ,
648649 product . version ,
649650 args . configuration [ 'terminal.integrated.detectLocale' ] ,
650651 args . configuration [ 'terminal.integrated.inheritEnv' ] !== false
@@ -700,7 +701,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
700701 return terminal ;
701702 }
702703
703- private async attachProcess ( _id : number ) : Promise < void > {
704+ private async attachToProcess ( _id : number ) : Promise < void > {
704705 // TODO: Won't be necessary until we have persistent terminals.
705706 throw new Error ( 'not implemented' ) ;
706707 }
@@ -743,8 +744,14 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
743744 throw new Error ( 'not implemented' ) ;
744745 }
745746
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 [ ] > {
748755 const terminals = await Promise . all ( Array . from ( this . terminals ) . map ( async ( [ id , terminal ] ) => {
749756 return terminal . description ( id ) ;
750757 } ) ) ;
@@ -786,6 +793,14 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
786793
787794 return { tabs } ;
788795 }
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+ }
789804}
790805
791806function transformIncoming ( remoteAuthority : string , uri : UriComponents | undefined ) : URI | undefined {
0 commit comments