Skip to content

.zshrc is overriding the environment variable set by shell integration on macOS #205102

@karrtikr

Description

@karrtikr

Does this issue occur when all extensions are disabled?: Yes/No

Reporting on behalf of @pquadri: microsoft/vscode-python#22901

VS Code version: Code 1.86.1 (Universal) (31c37ee, 2024-02-07T09:09:01.236Z)
OS version: Darwin arm64 23.3.0

Steps to Reproduce:

  1. Python extension sets the environment variable collection using EnvironmentCollection.prepend API, by using options: {"applyAtShellIntegration":true,"applyAtProcessCreation":true}:
Prepending environment variable PATH in collection with value "<prepend>"
  1. Value of PATH in zsh terminal:
/Users/paolo.quadri/.local/bin:/Users/paolo.quadri/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:<prepend>:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:<prepend>

As one can notice <prepend> is appearing twice, which is expected, but .zshrc seems to be running after it which is why <prepend> isn't the first entry in PATH.
image
shell integration:
image

Metadata

Metadata

Assignees

Labels

confirmation-pendinginfo-neededIssue requires more information from posterterminal-shell-integrationShell integration infrastructure, command decorations, etc.terminal-shell-zshAn issue in the terminal specific to zsh, including shell integration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions