-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
VSCode Shell Commands not retaining install status in $PATH after restart #42051
Comments
After you install it from Code, does it exist in |
Same issue for me/after restart code was missing from This seems to work for now:
cat << EOF >> ~/.bash_profile
# Add Visual Studio Code (code)
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF |
There must be something in your system removing the shortcut from |
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! |
I have a clean install macOS 10.13.3, and have the same issue. Is that a common issue on the latest macOS? |
Same issue here. |
Hope this helps you @sherlockwang @dassennato:
Shout out to @nathanfu88 for the help solving this issue! |
I've been having this problem on my machine and I think I might have figured it out. It looks like I've been running VS Code from ~/Downloads instead of from /Applications. Once I did that, the "code ." works just by editing .bash_profile. Maybe this is a problem with the installer? |
^ benday, THANK YOU for this comment. I realized this is exactly what I was doing too. |
@benday @illyay2017 Damn! same here. I moved the app to /Applications and it got fixed. Thanks! |
@benday Thanks ... 🤦♂️ |
@benday OMG I did not know this until today.... thank you. BUT the installer should have taken care of it (moving the app to the Applications folder). |
Give @benday a job on the VSCode team. |
Nope, still doesn't work for me. I've tried all the above steps. Any other ideas? |
@gebigoma I use MacOS High Sierra 10.13.6 and VS Code 1.26.1. Can you update yours to latest version, see if it works? After I updated VS Code, the problem went away (of course after I moved VS Code into Application folder). |
@danielnmai It's all updated, same MacOS version as yours but my VS code is 1.27.1, so even newer than your version. |
There could be something with your terminal setup. I use iTerm2 and zsh shell, if this helps. |
Thanks, @benday. Same issue with me, was always running from Downloads instead of Applications. Moving Code to the Applications fixed it for me! |
@benday Thanks so much, moving the application to the correct folder fixed it for me as well. |
Thanks @benday . You are my saviour :) |
Thanks @benday!! Same with me |
I was having the same problem, but unlike @benday, I was running VS Code from /Applications (not from ~/Downloads). Turns out I still had the To fix the issue, I followed the instructions in #48124 (comment) and ran: xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app IMO since this seems to cause confusion, VS Code should show a warning if "Shell Command: Install 'code' command in PATH" is invoked when running from a read-only file system, as in Squirrel/Squirrel.Mac#186. Even better would be to offer the user to fix it for them. |
Thanks @benday!!! |
thanks man, you saved me a lot of headaches 🙇 |
Thanks a ton @benday . |
@loriculberson That works for me, thanks! |
@matangover Thx! It works. |
THANK YOU MY GOD, I WAS SOMEHOW RUNNING MINE FROM THE TRASH. |
ce224ae - Improve formatting of printed comments - Add `code`/`codium` command to PATH for macOS - Add VSCodium as default distro: `CODE_DISTRO=${CODE_DISTRO:-"codium"}` - Add error message if using Codespaces: Codespaces seems to have a limited version of the VSCode CLI that can't install extensions. https://code.visualstudio.com/docs/setup/mac microsoft/vscode#42051 https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces
ce224ae - Improve formatting of printed comments - Add `code`/`codium` command to PATH for macOS - Add VSCodium as default distro: `CODE_DISTRO=${CODE_DISTRO:-"codium"}` - Add error message if using Codespaces: Codespaces seems to have a limited version of the VSCode CLI that can't install extensions. https://code.visualstudio.com/docs/setup/mac microsoft/vscode#42051 https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces
Steps to Reproduce:
I launch most of my files from Terminal, I recently got a new laptop with 10.13.2 installed on it. Installed VSCode, and then installed shell commands through VSCodes command palette. Every time I restart my computer the 'code' command is not found. I have to launch VSCode from applications and then reinstall the shell commands.
The text was updated successfully, but these errors were encountered: