Extension|Author (truncated)|Version
---|---|---
vscode-markdownlint|Dav|0.12.1
PowerShell|ms-|1.5.1
markdown-pdf|yza|0.1.7
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.
After you install it from Code, does it exist in /usr/local/bin/code
? After you restart, is it still there?
Same issue for me/after restart code was missing from /usr/local/bin
.
This seems to work for now:
To manually add VS Code to your path:
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 /usr/local/bin
. You should try to find out what that is.
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.
I have to install the code command every time I restart my new macbook, macOS 10.13.4
Hope this helps you @sherlockwang @dassennato:
NOTE: This is slightly different from the path listed in the vs code documentation. The path listed below has:
\
" "
\
to escape the spaces in the pathexport PATH=$PATH:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin
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 quarantine
attribute set on VS Code -- probably because I had moved it from ~/Downloads to /Applications using mv instead of Finder. Only moving it using Finder removes the quarantine attribute.
To fix the issue, I followed the instructions in https://github.com/Microsoft/vscode/issues/48124#issuecomment-383614238 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!!!
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?
thanks man, you saved me a lot of headaches 🙇
Thanks a ton @benday .
@loriculberson That works for me, thanks!
@matangover Thx! It works.
My vscode is located at /Applications but still act like starting from another weird place like ~/Downloads.
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?
THANK YOU MY GOD, I WAS SOMEHOW RUNNING MINE FROM THE TRASH.
Most helpful comment
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?