Description
Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version: 1.89.1
- OS Version: macOS 14.5
Steps to Reproduce:
- Install VSCode on macos
Expected:
File type associations are opt-in
Actual:
All code files now open with vscode
This is a continuation of #8687 and #51252, but those issues were auto-locked, so continuing the discussion here.
The current recommendation in those issues is to uninstall VSCode.
That's not a great solution but appears to be the only solution.
I'm filing this issue because I found another workaround and wanted to share with other users: manually editing the Info.plist
to remove CFBundleDocumentTypes
/ CFBundleTypeExtensions
.
In short:
-
Make a backup
cp /Applications/Visual\ Studio\ Code.app/Contents/Info.plist /Applications/Visual\ Studio\ Code.app/Contents/Info.plist.backup
-
Edit
Info.plist
vim /Applications/Visual\ Studio\ Code.app/Contents/Info.plist
-
Remove all or specific CFBundleTypeExtensions entries
For deleting the entries remove everything between twodict
tags, e.g. delete this to remove the.h
association<dict> <key>CFBundleTypeExtensions</key> <array> <string>h</string> </array> <key>CFBundleTypeIconFile</key> <string>c.icns</string> <key>CFBundleTypeName</key> <string>C header file</string> <key>CFBundleTypeOSTypes</key> <array> <string>TEXT</string> <string>utxt</string> <string>TUTX</string> <string>****</string> </array> <key>CFBundleTypeRole</key> <string>Editor</string> </dict>
-
Save the updated
Info.plist
-
Resign the application so you can open it
codesign --force --deep --sign - /Applications/Visual\ Studio\ Code.app
-
Force launch services to re-register the application
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister -f /Applications/Visual\ Studio\ Code.app
Activity