microsoft / vscode

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

Unexplainable "Resolving Shell Environment is Slow" warning and error #116527

Closed mcamou closed 3 years ago

mcamou commented 3 years ago

Issue Type: Performance Issue

I am running KDE on Linux with zsh. When starting VS Code via the Applications menu or KRunner, I get the "Unable to resolve your shell environment in a reasonable time" error. According to https://code.visualstudio.com/docs/supporting/faq#_resolving-shell-environment-is-slow-error-warning it means that running my .zshrc is taking more than 10 seconds.

However, starting up Konsole takes up less than 2 seconds from the moment I click on the icon to the moment that I get a shell prompt. What is VS Code doing that Konsole is not, that it takes more than 10 seconds to run my .zshrc?

Also, I really can't remove anything from .zshrc (I need it for actual terminal sessions). Is there a way of determining whether .zshrc is being executed by VS Code so that I can conditionally enable/disable parts of it?

VS Code version: Code 1.53.2 (622cb03f7e070a9670c94bae1a45d78d7181fbd4, 2021-02-11T11:48:44.518Z) OS version: Linux x64 5.8.0-43-generic

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 4240)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|62.43GB (3.99GB free)| |Process Argv|--no-sandbox --crash-reporter-id 7a718ecd-9851-42e5-8f06-b01c3b045a37| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|plasma| |XDG_CURRENT_DESKTOP|KDE| |XDG_SESSION_DESKTOP|KDE| |XDG_SESSION_TYPE|x11|
Process Info ``` CPU % Mem MB PID Process 0 128 3706169 code main 0 0 3706177 zygote 0 64 3706224 gpu-process 0 0 3706179 zygote 0 64 3724496 window (Issue Reporter) 0 0 3706242 utility 0 64 3707031 shared-process 0 0 3733610 /bin/sh -c /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 0 0 3733611 /usr/bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 0 192 3714135 window (event-projector-to-sql - ~/work/actyx/projects/files/tickets/362/find-negative-duration-events.sh (~/work/actyx/projects/src/event-projector-to-sql) - Visual Studio Code) 0 384 3714184 extensionHost 0 64 3714543 electron_node server.js 0 0 3714544 node /home/mario/.vscode/extensions/mtxr.sqltools-0.23.0/dist/languageserver.js --node-ipc --clientProcessId=3714184 0 64 3714576 electron_node server.js 0 767 3714646 /home/mario/.config/Code/User/globalStorage/matklad.rust-analyzer/rust-analyzer-x86_64-unknown-linux-gnu 0 192 3714654 electron_node server.js 0 0 3714206 watcherService 0 0 3714258 searchService ```
Workspace Info ``` | Window (event-projector-to-sql - ~/work/actyx/projects/files/tickets/362/find-negative-duration-events.sh (~/work/actyx/projects/src/event-projector-to-sql) - Visual Studio Code) | Folder (event-projector-to-sql): 9752 files | File types: o(1818) json(945) timestamp(922) d(832) rmeta(702) | rlib(484) h(208) rs(58) bin(51) ll(34) | Conf files: launch.json(1) settings.json(1) makefile(1) | Launch Configs: lldb(3); ```
Extensions (118) Extension|Author (truncated)|Version ---|---|--- logcat|abh|0.0.7 android-dev-ext|ade|1.3.2 Bookmarks|ale|12.1.4 androidify|ara|0.0.1 armview|ben|0.4.5 github-markdown-preview|bie|0.0.2 markdown-checkbox|bie|0.1.3 markdown-emoji|bie|0.0.9 markdown-preview-github-styles|bie|0.1.6 markdown-yaml-preamble|bie|0.0.4 jump-to-test|bla|0.0.4 better-toml|bun|0.3.2 vscode-typescript-refactors|can|0.0.22 multi-cursor-case-preserve|Car|1.0.5 npm-intellisense|chr|1.3.1 path-intellisense|chr|2.3.0 regex|chr|0.2.0 bracket-pair-colorizer|Coe|1.0.61 githistory|don|0.6.14 vscode-code-runner|dor|1.0.11 xml|Dot|2.5.1 gitlens|eam|11.2.1 EditorConfig|Edi|0.16.4 vscode-npm-script|eg2|0.3.15 vscode-great-icons|emm|2.1.64 pull-request-monitor|eri|1.7.1 prettier-vscode|esb|5.9.2 create-test|esk|1.3.2 vscode-debug-launcher|fab|2.1.0 vscode-diff|fab|1.4.0 vscode-highlight|fab|1.4.1 vscode-open-in-node-modules|fab|1.1.1 git-project-manager|fel|1.7.1 docker-explorer|for|0.1.7 vscode-node-red|for|0.2.0 seito-openfile|Fr4|1.8.7 kotlin|fwc|0.2.20 vscode-pull-request-github|Git|0.23.1 cloudcode|goo|1.8.0 gc-excelviewer|Gra|3.0.41 todo-tree|Gru|0.0.196 vscode-systemd-support|han|0.1.1 vscode-test-explorer|hbe|2.19.5 rust-test-lens|hde|1.0.0 debug-visualizer|hed|2.0.6 rest-client|hum|0.24.4 gzipdecompressor|Hyu|1.2.0 output-colorizer|IBM|0.1.2 javascript-unit-test-snippet|iZD|1.0.0 search-node-modules|jas|1.3.0 better-shellscript-syntax|jef|1.1.0 vscode-peacock|joh|3.9.1 chat|kar|0.35.0 vscode-github|Kni|0.30.4 bash-ide-vscode|mad|1.11.0 camelcasenavigation|map|1.1.3 Kotlin|mat|1.7.1 rust-analyzer|mat|0.2.481 rainbow-csv|mec|1.8.1 dotenv|mik|1.0.1 vscode-android-webview-debug|mpo|1.1.1 azure-pipelines|ms-|1.183.0 vscode-apimanagement|ms-|0.1.8 vscode-azureappservice|ms-|0.20.0 vscode-azurefunctions|ms-|1.2.1 vscode-azureresourcegroups|ms-|0.2.0 vscode-azurestorage|ms-|0.11.0 vscode-azurevirtualmachines|ms-|0.3.0 vscode-cosmosdb|ms-|0.15.1 vscode-docker|ms-|1.9.1 vscode-dotnet-runtime|ms-|1.0.0 remote-containers|ms-|0.158.0 remote-ssh|ms-|0.63.0 remote-ssh-edit|ms-|0.63.0 remote-wsl|ms-|0.53.4 vscode-remote-extensionpack|ms-|0.20.0 azure-account|ms-|0.9.6 azurecli|ms-|0.5.0 vscode-node-azure-pack|ms-|0.1.0 vscode-typescript-tslint-plugin|ms-|1.3.3 vsliveshare|ms-|1.0.3629 vsliveshare-audio|ms-|0.1.91 vsliveshare-pack|ms-|0.4.0 azurerm-vscode-tools|msa|0.14.1 export-typescript|msc|0.3.2 debugger-for-chrome|msj|4.12.12 sqltools|mtx|0.23.0 sqltools-driver-mssql|mtx|0.2.0 sqltools-driver-pg|mtx|0.2.0 sqltools-driver-sqlite|mtx|0.2.0 gradle-language|nac|0.2.3 vscode-json-transform|oct|0.1.2 openhab|ope|0.8.0 java|red|0.75.0 edit-with-shell|ryu|1.2.0 scala|sca|0.5.1 metals|sca|1.9.13 crates|ser|0.5.5 code-settings-sync|Sha|3.4.3 packagelinker|sin|0.0.6 code-spell-checker|str|1.10.2 copy-with-imports|str|0.1.7 vscode-rust-test-adapter|Swe|0.11.0 open-in-browser|tec|2.0.0 json-utils|ted|1.0.8 shellcheck|tim|0.13.2 autocomplate-shell|tru|0.1.1 vscode-lldb|vad|1.6.1 vscodeintellicode|Vis|1.2.11 azure-iot-toolkit|vsc|2.16.4 vscode-java-debug|vsc|0.31.0 vscode-java-dependency|vsc|0.18.0 vscode-java-pack|vsc|0.12.1 vscode-java-test|vsc|0.28.0 vscode-maven|vsc|0.27.1 quokka-vscode|Wal|1.0.342 local-history|xyz|1.8.1 pull-requester|yos|0.1.5 (6 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspyt653:30253241 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstry244:30256636 pythonvsdeb440:30248342 pythonvsded773:30248341 vstes627:30244334 pythonvspyt600cf:30251589 ```
bpasero commented 3 years ago

We are working on removing the need to block the startup for this.

/duplicate https://github.com/microsoft/vscode/issues/108804