@@ -15,8 +15,7 @@ import { createWaitMarkerFileSync } from '../../platform/environment/node/wait.j
15
15
import { PipeCommand } from '../../workbench/api/node/extHostCLIServer.js' ;
16
16
import { hasStdinWithoutTty , getStdinFilePath , readFromStdin } from '../../platform/environment/node/stdin.js' ;
17
17
import { DeferredPromise } from '../../base/common/async.js' ;
18
-
19
- const __dirname = dirname ( url . fileURLToPath ( import . meta. url ) ) ;
18
+ import { FileAccess } from '../../base/common/network.js' ;
20
19
21
20
/*
22
21
* Implements a standalone CLI app that opens VS Code from a remote terminal.
@@ -150,7 +149,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
150
149
case 'fish' : file = 'fish_xdg_data/fish/vendor_conf.d/shellIntegration.fish' ; break ;
151
150
default : throw new Error ( 'Error using --locate-shell-integration-path: Invalid shell type' ) ;
152
151
}
153
- console . log ( resolve ( __dirname , '../.. ' , 'workbench' , 'contrib' , 'terminal' , 'browser ' , 'media ' , file ) ) ;
152
+ console . log ( join ( getAppRoot ( ) , 'out ' , 'vs' , ' workbench', 'contrib' , 'terminal' , 'common ' , 'scripts ' , file ) ) ;
154
153
return ;
155
154
}
156
155
if ( cliPipe ) {
@@ -241,7 +240,7 @@ export async function main(desc: ProductDescription, args: string[]): Promise<vo
241
240
cmdLine . push ( '--update-extensions' ) ;
242
241
}
243
242
244
- const childProcess = cp . fork ( join ( __dirname , '../../../ server-main.js' ) , cmdLine , { stdio : 'inherit' } ) ;
243
+ const childProcess = cp . fork ( FileAccess . asFileUri ( ' server-main' ) . fsPath , cmdLine , { stdio : 'inherit' } ) ;
245
244
childProcess . on ( 'error' , err => console . log ( err ) ) ;
246
245
return ;
247
246
}
@@ -496,6 +495,10 @@ function mapFileToRemoteUri(uri: string): string {
496
495
return uri . replace ( / ^ f i l e : \/ \/ / , 'vscode-remote://' + cliRemoteAuthority ) ;
497
496
}
498
497
498
+ function getAppRoot ( ) {
499
+ return dirname ( FileAccess . asFileUri ( '' ) . fsPath ) ;
500
+ }
501
+
499
502
const [ , , productName , version , commit , executableName , ...remainingArgs ] = process . argv ;
500
503
main ( { productName, version, commit, executableName } , remainingArgs ) . then ( null , err => {
501
504
console . error ( err . message || err . stack || err ) ;
0 commit comments