@@ -163,9 +163,11 @@ export class LaunchService implements ILaunchService {
163163 const context = ! ! userEnv [ 'VSCODE_CLI' ] ? OpenContext . CLI : OpenContext . DESKTOP ;
164164 let usedWindows : ICodeWindow [ ] = [ ] ;
165165
166+ const waitMarkerFileURI = args . wait && args . waitMarkerFilePath ? URI . file ( args . waitMarkerFilePath ) : undefined ;
167+
166168 // Special case extension development
167169 if ( ! ! args . extensionDevelopmentPath ) {
168- this . windowsMainService . openExtensionDevelopmentHostWindow ( args . extensionDevelopmentPath , { context, cli : args , userEnv } ) ;
170+ this . windowsMainService . openExtensionDevelopmentHostWindow ( args . extensionDevelopmentPath , { context, cli : args , userEnv, waitMarkerFileURI } ) ;
169171 }
170172
171173 // Start without file/folder arguments
@@ -199,7 +201,14 @@ export class LaunchService implements ILaunchService {
199201 }
200202
201203 if ( openNewWindow ) {
202- usedWindows = this . windowsMainService . open ( { context, cli : args , userEnv, forceNewWindow : true , forceEmpty : true } ) ;
204+ usedWindows = this . windowsMainService . open ( {
205+ context,
206+ cli : args ,
207+ userEnv,
208+ forceNewWindow : true ,
209+ forceEmpty : true ,
210+ waitMarkerFileURI
211+ } ) ;
203212 } else {
204213 usedWindows = [ this . windowsMainService . focusLastActive ( args , context ) ] ;
205214 }
@@ -216,17 +225,18 @@ export class LaunchService implements ILaunchService {
216225 forceReuseWindow : args [ 'reuse-window' ] ,
217226 diffMode : args . diff ,
218227 addMode : args . add ,
219- noRecentEntry : ! ! args [ 'skip-add-to-recently-opened' ]
228+ noRecentEntry : ! ! args [ 'skip-add-to-recently-opened' ] ,
229+ waitMarkerFileURI
220230 } ) ;
221231 }
222232
223233 // If the other instance is waiting to be killed, we hook up a window listener if one window
224234 // is being used and only then resolve the startup promise which will kill this second instance.
225235 // In addition, we poll for the wait marker file to be deleted to return.
226- if ( args . wait && args . waitMarkerFilePath && usedWindows . length === 1 && usedWindows [ 0 ] ) {
236+ if ( waitMarkerFileURI && usedWindows . length === 1 && usedWindows [ 0 ] ) {
227237 return Promise . race ( [
228238 this . windowsMainService . waitForWindowCloseOrLoad ( usedWindows [ 0 ] . id ) ,
229- whenDeleted ( args . waitMarkerFilePath )
239+ whenDeleted ( waitMarkerFileURI . fsPath )
230240 ] ) . then ( ( ) => undefined , ( ) => undefined ) ;
231241 }
232242
0 commit comments