diff --git a/src/cli.js b/src/cli.js index 898145f2ae3..6d2a3133322 100644 --- a/src/cli.js +++ b/src/cli.js @@ -6,6 +6,13 @@ //@ts-check 'use strict'; +// Delete `VSCODE_CWD` very early. We have seen +// reports where `code .` would use the wrong +// current working directory due to our variable +// somehow escaping to the parent shell +// (https://github.com/microsoft/vscode/issues/126399) +delete process.env['VSCODE_CWD']; + // ESM-comment-begin const bootstrap = require('./bootstrap'); const bootstrapNode = require('./bootstrap-node'); @@ -25,13 +32,6 @@ const product = require('./bootstrap-meta').product; // const __dirname = path.dirname(fileURLToPath(import.meta.url)); // ESM-uncomment-end -// Delete `VSCODE_CWD` very early. We have seen -// reports where `code .` would use the wrong -// current working directory due to our variable -// somehow escaping to the parent shell -// (https://github.com/microsoft/vscode/issues/126399) -delete process.env['VSCODE_CWD']; - async function start() { // NLS