Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

= and all following contents discarded from .env environment variables #23078

Closed
DanielRosenwasser opened this issue Mar 14, 2024 · 4 comments
Closed
Labels
feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team

Comments

@DanielRosenwasser
Copy link
Member

It appears that the contents of variables loaded from .env (or envFile) are incorrectly set if they contain an = within the value.

To repro this, add the following .env file to the top level of a workspace.

OOPS="WHAT=THE"
SOME_ENV_VARIABLE=https://example.com?api-version=2024-02-15-preview

Then create a new terminal and run the following commands

echo $OOPS
echo $SOME_ENV_VARIABLE

Current Behavior

WHAT
https://example.com?api-version

Expected Behavior

WHAT=THE
https://example.com?api-version=2024-02-15-preview
@DanielRosenwasser DanielRosenwasser added the feature-request Request for new features or functionality label Mar 14, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 14, 2024
@DanielRosenwasser DanielRosenwasser changed the title Variables loaded from .env discards all contents following = Variables loaded from .env have all contents following = discarded Mar 14, 2024
@DanielRosenwasser
Copy link
Member Author

DanielRosenwasser commented Mar 15, 2024

Compounded with the behavior of dotenv described at #22982, this causes all sorts of unexpected behavior. I couldn't tell where my environment variables were being set within a Codespace and was banging my head against this before I opened up microsoft/TypeChat#211.

@DanielRosenwasser DanielRosenwasser changed the title Variables loaded from .env have all contents following = discarded = and all following contents discarded from .env environment variables Mar 15, 2024
@karrtikr
Copy link

This is actually an issue on VS Code: microsoft/vscode#197603, closing as duplicate. We encourage you interact with that issue to raise priority.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@DanielRosenwasser
Copy link
Member Author

With microsoft/vscode#207889, this will be fixed in the March 2024 release of VS Code.

@karrtikr
Copy link

Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants