Fix: macOS Dock Right-Click Acting Like Left-Click & VS Code Recents Not Opening
If you use macOS and rely on the VS Code Dock menu to switch projects, you might have run into a bizarre issue where your “Recent Folders” list is visible, but clicking an item does absolutely nothing.
Here are the specific symptoms I encountered:
- Unresponsive Recent Folders: You can see the list of recent projects in the VS Code Dock menu, but clicking them triggers no action.
- Dock Right-Click Glitch: The issue spreads to other apps in the Dock. Right-clicking (or two-finger clicking) an icon behaves exactly like a left-click. It simply brings the app window to the front instead of showing the menu.
- The “Control” Exception: If you hold
Controland click, the menu appears and functions correctly.
If you experience one or more of these symptoms, you are likely affected by the same underlying problem.
The Solution
You can fix this by clearing the extended attributes on the VS Code application bundle.
Follow these steps:
- Quit VS Code completely using
⌘Q. - Open your Terminal.
- Paste and run the following command (assuming your app is in the standard Applications folder):
xattr -cr /Applications/Visual\ Studio\ Code.app
- (Optional) You can restart the Dock if the change doesn’t happen immediately:
killall Dock
Why Does This Happen?
While I haven’t seen an official explanation, I suppose the reason is related to how macOS handles security “quarantine” flags or extended attributes (xattr).
It seems that a stuck attribute causes the Dock to misinterpret the input event. It might be filtering out the specific command to open the folder or treating the right-click as a standard activation. Manually clearing the attributes resolves this confusion.
Comments