Microsoft/vscode

Allow blocked environment variables through if they're included explicitly in terminal launch configs

開放

#104,154 建立於 2020年7月15日

 (9 則留言) (1 個反應) (1 位負責人)TypeScript (39,847 個分叉)batch import
feature-requesthelp wantedterminal-process

倉庫指標

星標
 (184,936 顆星)
PR 合併指標
 (平均合併 11小時 43分鐘) (30 天內合併 1,000 個 PR)

描述

  • VSCode Version: 1.47.1 (not insider as I can't get docker builds working on that for some reason)
  • Local OS Version: Windows 10 2004
  • Remote OS Version: WSL2 Ubuntu 20.04
  • Remote Extension/Connection Type: Docker Desktop using WSL2 backend

Steps to Reproduce:

  1. Create a new project with a single file:
# .devcontainer/devcontainer.json
{
  "image": "alpine:latest",
  "remoteEnv": {
    "GOOGLE_API_KEY": "api-key",
    "GOOGLE_SOMETHING_ELSE": "something-else"
  }
}
  1. Rebuild and Reopen in Container
  2. In the remote terminal, check the environment for variables:
$ printenv | grep GOOGLE

Expected outcome:

GOOGLE_API_KEY=api-key
GOOGLE_SOMETHING_ELSE=something-else

Actual outcome:

GOOGLE_SOMETHING_ELSE=something-else

This is the same no matter the base image used. Changing the name of GOOGLE_API_KEY to anything else, even by a single character, allows it through.

Does this issue occur when you try this locally?: Not relevant as this is a remote container build Does this issue occur when you try this locally and all extensions are disabled?: Not relevant as this is a remote container build

貢獻者指南