cli - improve fix for #126399 by unsetting VSCODE_CWD early

This commit is contained in:
Benjamin Pasero 2021-06-19 08:12:10 +02:00
parent f555564a4b
commit b2614ce504
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65

View file

@ -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');