@@ -37,6 +37,7 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA
3737// tslint:disable-next-line: import-patterns
3838import { IExperimentService , IExperiment , ExperimentActionType , ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService' ;
3939import { ExtensionHostDebugChannelClient , ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc' ;
40+ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService' ;
4041
4142//#region Extension Tips
4243
@@ -293,7 +294,8 @@ export class SimpleWindowService extends Disposable implements IWindowService {
293294 @IConfigurationService private readonly configurationService : IConfigurationService ,
294295 @IStorageService private readonly storageService : IStorageService ,
295296 @IWorkspaceContextService private readonly workspaceService : IWorkspaceContextService ,
296- @ILogService private readonly logService : ILogService
297+ @ILogService private readonly logService : ILogService ,
298+ @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService : IWorkbenchEnvironmentService
297299 ) {
298300 super ( ) ;
299301
@@ -489,7 +491,7 @@ export class SimpleWindowService extends Disposable implements IWindowService {
489491 for ( let i = 0 ; i < _uris . length ; i ++ ) {
490492 const uri = _uris [ i ] ;
491493 if ( 'folderUri' in uri ) {
492- const newAddress = `${ document . location . origin } /?folder=${ uri . folderUri . path } ` ;
494+ const newAddress = `${ document . location . origin } /?folder=${ uri . folderUri . path } ${ this . workbenchEnvironmentService . configuration . connectionToken ? `&tkn= ${ this . workbenchEnvironmentService . configuration . connectionToken } ` : '' } ` ;
493495 if ( openFolderInNewWindow ) {
494496 window . open ( newAddress ) ;
495497 } else {
@@ -608,6 +610,10 @@ export class SimpleWindowsService implements IWindowsService {
608610 readonly onWindowUnmaximize : Event < number > = Event . None ;
609611 readonly onRecentlyOpenedChange : Event < void > = Event . None ;
610612
613+ constructor (
614+ @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService : IWorkbenchEnvironmentService
615+ ) {
616+ }
611617 isFocused ( _windowId : number ) : Promise < boolean > {
612618 return Promise . resolve ( true ) ;
613619 }
@@ -778,6 +784,9 @@ export class SimpleWindowsService implements IWindowsService {
778784 newAddress += `&ibe=${ encodeURIComponent ( ibe ) } ` ;
779785 }
780786
787+ // add connection token
788+ newAddress += `${ this . workbenchEnvironmentService . configuration . connectionToken ? `tkn=${ this . workbenchEnvironmentService . configuration . connectionToken } ` : '' } ` ;
789+
781790 window . open ( newAddress ) ;
782791
783792 return Promise . resolve ( ) ;
0 commit comments