From 0dffaf0a35c044ecdff3e60deedf702809cfc660 Mon Sep 17 00:00:00 2001 From: Robo Date: Wed, 10 Jul 2024 23:53:39 +0900 Subject: [PATCH] fix: restore VSCODE_CWD fix when resolving current working directory (#221373) --- src/cli.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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