From 68a3453ed1de6279dc8a44e7d846b92a0953ebe9 Mon Sep 17 00:00:00 2001 From: David Schafhauser Date: Wed, 17 Jun 2020 14:14:24 +0200 Subject: [PATCH] fix #7973: Collect env vars lowercase on windows - Populate local copy of environment variables with lowercase keys if on Windows platform - Fix #7973: Environment variables are not retrieved properly on Windows - Update changelog Signed-off-by: David Schafhauser --- CHANGELOG.md | 5 ++++- .../core/src/node/env-variables/env-variables-server.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96fcb7b91ce2f..1f02bea945acf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## v1.4.0 + +- [core] fixed handling of environment variables on Windows [#7973](https://github.com/eclipse-theia/theia/pull/7973) + ## v1.3.0 - [cli] updated the download script to warn about mandatory `theiaPlugins` field [#8058](https://github.com/eclipse-theia/theia/pull/8058) @@ -49,7 +53,6 @@ Breaking Changes: - [shell] updated `ApplicationShell.TrackableWidgetProvider.getTrackableWidgets` to be synchronous in order to register child widgets in the same tick [#7957](https://github.com/eclipse-theia/theia/pull/7957) - use `ApplicationShell.TrackableWidgetProvider.onDidChangeTrackableWidgets` if child widgets are added asynchronously - ## v1.2.0 - [application-manager] added ability for clients to add `windowOptions` using an IPC-Event [#7803](https://github.com/eclipse-theia/theia/pull/7803) diff --git a/packages/core/src/node/env-variables/env-variables-server.ts b/packages/core/src/node/env-variables/env-variables-server.ts index 165fc05c3d2d9..a9efe099b5bae 100644 --- a/packages/core/src/node/env-variables/env-variables-server.ts +++ b/packages/core/src/node/env-variables/env-variables-server.ts @@ -30,7 +30,11 @@ export class EnvVariablesServerImpl implements EnvVariablesServer { constructor() { const prEnv = process.env; Object.keys(prEnv).forEach((key: string) => { - this.envs[key] = { 'name': key, 'value': prEnv[key] }; + let keyName = key; + if (isWindows) { + keyName = key.toLowerCase(); + } + this.envs[keyName] = { 'name': keyName, 'value': prEnv[key] }; }); }