Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATH not set correctly when using macos with zsh shell and oh-my-zsh #107169

Closed
despian opened this issue Sep 21, 2020 · 13 comments
Closed

PATH not set correctly when using macos with zsh shell and oh-my-zsh #107169

despian opened this issue Sep 21, 2020 · 13 comments
Assignees
Labels
info-needed Issue requires more information from poster macos Issues with VS Code on MAC/OS X terminal General terminal issues that don't fall under another label

Comments

@despian
Copy link

despian commented Sep 21, 2020

Issue Type: Bug

If I launch vscode from finder or the dock it always loads the incorrect path:

/Users/matt/.platformio/penv/bin:/Users/matt/.platformio/penv:/Users/matt/.platformio/python3/bin:/usr/bin:/bin:/usr/sbin:/sbin

If I launch it from the command line it loads the correct path:

/opt/local/share/java/android-sdk-macosx/platform-tools:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/matt/.nvm/versions/node/v12.18.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/matt/Library/Python/3.6/bin

Strangely, if I close the app after launching from the command line and re-launch it via finder or the dock it will now load the correct path (until the next reboot).

I'm using zsh and oh-my-zsh. Many other users using this tool have reported the same issue:

#83155
#104029
dotnet/vscode-csharp#4037

"terminal.integrated.inheritEnv": true is already set but the problem persists.

I had been using oh-my-zsh for years and not seen this issue. It seems maybe it started after a recent macos update.

VS Code version: Code 1.49.1 (58bb7b2, 2020-09-16T23:21:17.533Z)
OS version: Darwin x64 19.6.0

System Info
Item Value
CPUs Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz (4 x 2900)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 7, 5, 5
Memory (System) 16.00GB (0.08GB free)
Process Argv --crash-reporter-id 36e0788d-966a-44b4-8021-5bac0dc93349
Screen Reader no
VM 0%
Extensions (25)
Extension Author (truncated) Version
azurite Azu 3.8.0
yarn-task-provider dkn 0.2.2
xml Dot 2.5.1
prettier-vscode esb 5.6.0
php-debug fel 1.13.0
php-intellisense fel 2.3.14
php-pack fel 1.0.2
csharpextensions jch 1.3.1
vscode-text-pastry jkj 1.2.0
docomment k-- 0.1.18
vscode-healthier Kid 3.0.0
vscode-azurefunctions ms- 0.24.0
csharp ms- 1.23.2
mssql ms- 1.9.0
python ms- 2020.8.109390
azure-account ms- 0.9.3
cpptools ms- 1.0.0
powershell ms- 2020.6.0
debugger-for-chrome msj 4.12.10
openhab ope 0.7.0
platformio-ide pla 2.1.0
LiveServer rit 5.6.1
vscode-arduino vsc 0.3.2
debug web 0.25.0
t4-support zbe 0.5.0
@joaomoreno
Copy link
Member

There is something in your .zshrc which prevents VS Code from loading it in order to set the correct env.

Strangely, if I close the app after launching from the command line and re-launch it via finder or the dock it will now load the correct path (until the next reboot).

Also: if you simply open a command line and close it, would opening VS Code from finder work?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Sep 24, 2020
@il-tmfv
Copy link

il-tmfv commented Sep 28, 2020

I'm having the same issue. One of my extensions fails to run a task:

...
zsh:1: command not found: clojure
...

But if start VSCode using code . then everything is fine.

Also, it helps to run Developer: Reload window command. After that, the task is running without errors.

Started to happen after

Security Update 2020-005:

  Version:	10.14.6
  Source:	Apple

I'm using macOS Mojave 10.14.6, zsh 5.3 (x86_64-apple-darwin18.0), vscode 1.49.2 (e5e9e69)

Update:
The built-in terminal is able to run clojure command even when the task fails.
I haven't changed my .zshrc recently.
inheritEnv is set to true: "terminal.integrated.inheritEnv": true.

@mateusfccp
Copy link

I also started having this problem out of nowhere today.

Starting via terminal solves, but it would be nice to be able to launch VSCode through launcher.

@deepak1556
Copy link
Collaborator

Would like to bisect a potential candidate for this issue, can you all download the following two versions of code insiders and verify which one repros the issue. Thanks!

  1. https://az764295.vo.msecnd.net/insider/4ccab0deda29628076ce1bbb17e9fef239337f21/VSCode-darwin-insider.zip

  2. https://az764295.vo.msecnd.net/insider/f44d46d68233b3da5821554456d08f28e4efe841/VSCode-darwin-insider.zip

make sure to have the following setting

"update.mode": "none"

@deepak1556 deepak1556 added macos Issues with VS Code on MAC/OS X terminal General terminal issues that don't fall under another label labels Oct 9, 2020
@il-tmfv
Copy link

il-tmfv commented Oct 10, 2020

@deepak1556
I've tried both of them — no issues.
Yesterday "regular" VSCode received an update

Details
Version: 1.50.0
Commit: 93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
Date: 2020-10-07T06:00:00.397Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 18.7.0

and it also works fine now.

@despian
Copy link
Author

despian commented Oct 13, 2020

Just updated to Version: 1.50.0 (93c2f0f, 2020-10-07T06:00:00.397Z)

Can confirm it has fixed this issue for me as well 🙂

UPDATE:

Just rebooted after installing Version: 1.50.1 (d2e414d, 2020-10-13T14:53:05.704Z) and the problem has returned.

@deepak1556 I tried both of the insiders builds you linked to and they both work as expected. However, restarting my installed version of VSCode then also works correctly after running the insiders builds. I ran 4ccab0d first. Next time I reboot i'll try and remember and run the other build first and let you know if there is any difference.

@dsimanis
Copy link

dsimanis commented Oct 30, 2020

I am also at VSCode version 1.50.1 and having the same issue. Although, when I launch VSCode from the command line everything works just fine.

@mateusfccp
Copy link

mateusfccp commented Oct 30, 2020

Still happens to me with 1.50.1, build d2e414d9e4239a252d1ab117bd7067f125afd80a.

@despian
Copy link
Author

despian commented Nov 13, 2020

Just updated to Version: 1.51.1 (e5a624b, 2020-11-11T01:11:34.018Z) and the issue is still here.

@deepak1556 I have now rebooted and loaded the insider build f44d46d first and can confirm that this also resolves the issue.

@deepak1556
Copy link
Collaborator

@despian can you confirm if it is fixed with stable 1.51 ?

@mateusfccp
Copy link

mateusfccp commented Nov 25, 2020

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

8 days is no recent activity? Kay.

@deepak1556 For me it is correctly working now in version 1.51.1 (e5a624b)

@lu4
Copy link

lu4 commented Dec 19, 2020

Consider that some extensions like deno have an opinion regarding your environment settings, make sure they're not affecting .net environment. See dotnet/vscode-csharp#4037 (comment) for more info

@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster macos Issues with VS Code on MAC/OS X terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

8 participants
@joaomoreno @deepak1556 @lu4 @mateusfccp @despian @il-tmfv @dsimanis and others