Skip to content

Prepending using shell integration does not work for zsh, even when shell integration is activated #205133

@karrtikr

Description

@karrtikr

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

Extension version: 2024.1.10391007
VS Code version: Code 1.86.0 (0504748, 2024-01-31T10:27:46.147Z)

Opening on behalf of @JoelFeiner-viimed: microsoft/vscode-python#22881, and @matt-hires: microsoft/vscode-python#22899

Steps to Reproduce:

  1. Prepending environment variable PATH in environment collection with /home/joel/.vscode/extensions/ms-python.python-2024.1.10441459/pythonFiles/deactivate/zsh:/home/joel/.local/share/virtualenvs/edge-49eYqZTG/bin: using options: {"applyAtShellIntegration":true,"applyAtProcessCreation":true}

  2. Value of PATH in zsh, notice how /home/joel/.vscode/extensions/ms-python.python-2024.1.10441459/pythonFiles/deactivate/zsh:/home/joel/.local/share/virtualenvs/edge-49eYqZTG/bin: appears exactly once despite prepending it twice

  3. Prepending environment variable PATH in environment collection with the same value using options: {"applyAtShellIntegration":true,"applyAtProcessCreation":false}

  4. Value of PATH in zsh

/home/joel/.pyenv/shims:/home/joel/bin:/home/joel/pycharm/bin:/home/joel/.nvm/versions/node/v16.20.0/bin:/home/joel/.pyenv/bin:/home/joel/bin:/home/joel/pycharm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

Notice how the value is not prepended, both of them which suggests that automatic shell integration fails to prepend to PATH.

Relevant details:

.zshrc

export PATH="$HOME/bin:$HOME/pycharm/bin:$PATH"
export PAGER="less"
export LESS="$LESS -FRXK"
#export LESS="-iMSx4 -FX"

export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

setopt nointeractivecomments
setopt nosharehistory
unsetopt sharehistory

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

Shell integration is activated according to screenshot:

image

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code Insidersterminal-shell-integrationShell integration infrastructure, command decorations, etc.terminal-shell-zshAn issue in the terminal specific to zsh, including shell integrationverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions