[vscode-go] fix: apply shell integration for environment variables

0 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
4:54 AM (14 hours ago) 4:54 AM
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot has uploaded the change for review

Commit message

fix: apply shell integration for environment variables

Apply shell integration to ensure extension environment variables
like PATH take precedence over user exports in shell startup files.
Change-Id: Ifa0cdde710ac6afddc61cf99ed582bade62b78ab
GitHub-Last-Rev: 96c0c6cba0ef1616577c7a613c5b6ed1f79ccf1f
GitHub-Pull-Request: golang/vscode-go#3972

Change diff

diff --git a/extension/src/goEnvironmentStatus.ts b/extension/src/goEnvironmentStatus.ts
index 31d5d8d..512da2d 100644
--- a/extension/src/goEnvironmentStatus.ts
+++ b/extension/src/goEnvironmentStatus.ts
@@ -304,6 +304,11 @@
}
}

+const defaultMutatorOptions: vscode.EnvironmentVariableMutatorOptions = {
+ applyAtProcessCreation: true,
+ applyAtShellIntegration: true
+};
+
/**
* addGoRuntimeBaseToPATH adds the given path to the front of the PATH
* environment variable. It removes duplicates.
@@ -333,7 +338,7 @@
// Calling this multiple times will override the previous value.
// environmentVariableCollection.clear();
if (process.platform !== 'darwin') {
- environmentVariableCollection?.prepend(pathEnvVar, newGoRuntimeBase + path.delimiter);
+ environmentVariableCollection?.prepend(pathEnvVar, newGoRuntimeBase + path.delimiter, defaultMutatorOptions);
} else {
// When '-l' or '--login' flags are set, the terminal will invoke a login
// shell again and the paths from the user's login shell will be prepended
@@ -355,7 +360,11 @@
}
terminalCreationListener = vscode.window.onDidOpenTerminal(updateIntegratedTerminal);
} else {
- environmentVariableCollection?.prepend(pathEnvVar, newGoRuntimeBase + path.delimiter);
+ environmentVariableCollection?.prepend(
+ pathEnvVar,
+ newGoRuntimeBase + path.delimiter,
+ defaultMutatorOptions
+ );
}
}

Change information

Files:
  • M extension/src/goEnvironmentStatus.ts
Change size: S
Delta: 1 file changed, 11 insertions(+), 2 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: vscode-go
Gerrit-Branch: master
Gerrit-Change-Id: Ifa0cdde710ac6afddc61cf99ed582bade62b78ab
Gerrit-Change-Number: 736764
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Gopher Robot (Gerrit)

unread,
4:54 AM (14 hours ago) 4:54 AM
to Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gopher Robot added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Gopher Robot . unresolved

I spotted some possible problems with your PR:

  1. You usually need to reference a bug number for all but trivial or cosmetic fixes. For the vscode-go repo, the format is usually 'Fixes golang/vscode-go#1234' or 'Updates golang/vscode-go#1234' at the end of the commit message. Should you have a bug reference?

Please address any problems by updating the GitHub PR.

When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above. These findings are based on heuristics; if a finding does not apply, briefly reply here saying so.

To update the commit title or commit message body shown here in Gerrit, you must edit the GitHub PR title and PR description (the first comment) in the GitHub web interface using the 'Edit' button or 'Edit' menu entry there. Note: pushing a new commit to the PR will not automatically update the commit message used by Gerrit.

For more details, see:

(In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ifa0cdde710ac6afddc61cf99ed582bade62b78ab
    Gerrit-Change-Number: 736764
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Comment-Date: Sat, 17 Jan 2026 09:54:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Gopher Robot (Gerrit)

    unread,
    4:56 AM (14 hours ago) 4:56 AM
    to Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Message from Gopher Robot

    Congratulations on opening your first change. Thank you for your contribution!

    Next steps:
    A maintainer will review your change and provide feedback. See
    https://go.dev/doc/contribute#review for more info and tips to get your
    patch through code review.

    Most changes in the Go project go through a few rounds of revision. This can be
    surprising to people new to the project. The careful, iterative review process
    is our way of helping mentor contributors and ensuring that their contributions
    have a lasting impact.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ifa0cdde710ac6afddc61cf99ed582bade62b78ab
    Gerrit-Change-Number: 736764
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Comment-Date: Sat, 17 Jan 2026 09:56:43 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages