Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes/No <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --Extension version: 2024.1. VS Code version: Code 1.86.0 (, 2024-01-31T10:27:46.147Z) Opening on behalf of , and Steps to Reproduce: environment variable PATH in environment collection with using options: of in zsh, notice how appears exactly once despite prepending it twice environment variable PATH in environment collection with the same value using options: of in zsh Notice how the value is not prepended, both of them which suggests that automatic shell integration fails to prepend to . Relevant details: <details </summary<p</p</detailsShell integration is activated according to screenshot: !
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.86.1. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding!
Btw, both 633 and 133 shell integration sequences were not reported via the terminal data write event, so automatic shell integration may not be working, despite saying it's activated?
Yes, exactly this is happening on my system!
Since shell integration is getting activated, but the sequences are not coming through, the only thing I can imagine is that somewhere within our script, there's an error getting thrown so it exits before our sequences are put into place. I see that you have powerlevel 10k sourced within your . does commenting out these lines fix it?
reminded me that powerlevel 10k will disable our shell integration script from running by design as there were problems with the interplay of that and our shell integration.
We should be good to move the env stuff above the p10k exit to fix this problem:
Verified via code review

Discussion:
fi fi <del> # Shell integration was disabled by the shell, exit without warning assuming either the shell has # explicitly disabled shell integration as it's incompatible or it implements the protocol. if [ -z "$VSCODE_SHELL_INTEGRATION" ]; then builtin return fi </del> # Apply EnvironmentVariableCollections if needed if [ -n "${VSCODE_ENV_REPLACE:-}" ]; then IFS=':' read -rA ADDR <<< "$VSCODE_ENV_REPLACE"

unset VSCODE_ENV_APPEND fi <ins> # Shell integration was disabled by the shell, exit without warning assuming either the shell has # explicitly disabled shell integration as it's incompatible or it implements the protocol. if [ -z "$VSCODE_SHELL_INTEGRATION" ]; then builtin return fi </ins> # The property (P) and command (E) codes embed values which require escaping. # Backslashes are doubled. Non-alphanumeric characters are converted to escaped hex. __vsc_escape_value() {