microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.06k stars 28.8k forks source link

Shell environment resolution terminates with incorrect shell #208007

Open BlueFlame-SM opened 6 months ago

BlueFlame-SM commented 6 months ago

Type: Bug

VSCode does not resolve the correct shell environment for use by the application, breaking plugins which rely on it.

The $PATH variable used by VSCode is:

/home/timo/.local/bin:/opt/Xilinx/vivado_student/Vivado/2017.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/timo/.local/bin:/usr/local/go/bin

This matches my $PATH as defined in ~/.profile, but not the one in ~/.bashrc. If I start a shell (and run VSC from there) I have the path:

/home/timo/.cabal/bin:/home/timo/.ghcup/bin:/home/timo/.nvm/versions/node/v18.13.0/bin:/home/timo/android-ndk-r21e/toolchains/llvm/prebuilt/linux-x86_64/bin/:/usr/local/cuda-11.5/bin:/home/timo/.local/bin:/opt/Xilinx/vivado_student/Vivado/2017.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/timo/.local/bin:/usr/local/go/bin:/home/timo/.local/bin

VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:14:59.643Z) OS version: Linux x64 6.5.0-25-generic Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 x 3399)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|0, 1, 1| |Memory (System)|15.28GB (11.07GB free)| |Process Argv|--unity-launch --crash-reporter-id d2e8e6e0-6065-4083-a076-a38d5bc0aa04| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
Extensions (74) Extension|Author (truncated)|Version ---|---|--- vsc-prolog|art|0.8.23 vscode-intelephense-client|bme|1.10.2 doxdocgen|csc|1.4.0 yash|dao|0.2.9 vscode-eslint|dba|2.4.4 githistory|don|0.6.20 promela|dsv|0.4.0 civic-support|Dyl|0.5.0 gitlens|eam|14.9.0 vscode-html-css|ecm|2.0.9 php-intellisense|fel|2.3.14 godot-tools|gee|2.0.0 copilot|Git|1.174.0 copilot-chat|Git|0.13.1 vscode-pull-request-github|Git|0.82.0 go|gol|0.41.2 gc-excelviewer|Gra|4.2.59 haskell|has|2.5.2 haskell-linter|hoo|0.0.6 latex-workshop|Jam|9.19.1 better-cpp-syntax|jef|1.17.2 nutcracker|jer|0.0.3 cmake-language-support-vscode|jos|0.0.9 solidity|Jua|0.0.173 language-haskell|jus|3.6.0 vsc-python-indent|Kev|1.18.0 language-matlab|Mat|1.2.0 rainbow-csv|mec|3.11.0 csharp|ms-|2.22.3 vscode-dotnet-runtime|ms-|2.0.2 debugpy|ms-|2024.2.0 isort|ms-|2023.10.1 python|ms-|2024.2.1 vscode-pylance|ms-|2024.3.1 jupyter|ms-|2024.2.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 remote-containers|ms-|0.348.0 remote-ssh|ms-|0.109.0 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.86.0 cmake-tools|ms-|1.17.17 cpptools|ms-|1.19.8 cpptools-extension-pack|ms-|1.3.0 makefile-tools|ms-|0.9.10 mono-debug|ms-|0.16.3 remote-explorer|ms-|0.4.3 vsliveshare|ms-|1.0.5918 vsliveshare-pack|ms-|0.4.0 vscode-sanddance|msr|4.1.0 godot-csharp-vscode|nei|0.2.1 nsight-vscode-edition|nvi|2023.2.32964508 erlang|pgo|0.9.8 java|red|1.28.1 vscode-commons|red|0.0.6 vscode-xml|red|0.26.1 vscode-sort-json|ric|1.20.0 LiveServer|rit|5.7.9 shader|sle|1.1.5 lua|sum|3.7.4 open-in-browser|tec|2.0.0 cmake|twx|0.0.17 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 vscode-java-debug|vsc|0.56.2 vscode-java-dependency|vsc|0.23.5 vscode-java-pack|vsc|0.25.15 vscode-java-test|vsc|0.40.1 vscode-maven|vsc|0.44.0 php-debug|xde|1.34.0 php-pack|xde|1.0.3 php-intellisense|zob|1.3.3 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:30979542 d34g3935:30971562 fegfb526:30981948 bg6jg535:30979843 dsvsc020:30976470 gee8j676:30988843 ```
SharerMax commented 6 months ago

same problem. I use zsh shell and os is Arch

my node is provided nvm. node can't found when start debug

I print $PATH from task and terminal

task 'echo $PATH'

/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_per

In terminal

/home/max/.local/share/pnpm:/home/max/.nvm/versions/node/v20.11.1/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

VScode Info: Version: 1.87.2 Commit: 863d2581ecda6849923a2118d93a088b0745d9d6 Date: 2024-03-08T15:14:59.643Z Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Linux x64 6.8.1-arch1-1