diff --git a/src/cli.js b/src/cli.js index 001aed02c0f..d41c0ebaf94 100644 --- a/src/cli.js +++ b/src/cli.js @@ -6,6 +6,14 @@ //@ts-check 'use strict'; +// Delete `VSCODE_CWD` very early even before +// importing bootstrap files. 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']; + const bootstrap = require('./bootstrap'); const bootstrapNode = require('./bootstrap-node'); const product = require('../product.json');