Skip to content

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented May 17, 2023

Fixes #181934
Part of #179476

cc @karrtikr

@Tyriar Tyriar added this to the May 2023 milestone May 17, 2023
@Tyriar Tyriar self-assigned this May 17, 2023
foreach ($Item in $Split) {
$Inner = $Item.Split('=')
[Environment]::SetEnvironmentVariable($Inner[0], $Inner[1])
[Environment]::SetEnvironmentVariable($Inner[0], $Inner[1].Replace('\x3a', ':'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify what this does?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When vscode sets the variable it will ensure all values have : encoded as \x3a', so to test this out you'll want to encode the values like this:

VAR1=VAL1:VAR2=http\x3a//github.com

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do it this way because we can't pass \0 into environment variables and splitting multi-character strings is tricky in some shells.

@Tyriar Tyriar merged commit 77b45bd into main May 17, 2023
@Tyriar Tyriar deleted the tyriar/delimiter branch May 17, 2023 17:11
@github-actions github-actions bot locked and limited conversation to collaborators Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VSCODE_ENV_* variables to adjust environment in shell integration script do not work

3 participants