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

macOS: pressing Enter on visible context menu in explorer triggers "Rename" always #242513

Open
claycoleman opened this issue Mar 3, 2025 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member keybindings VS Code keybinding issues system-context-menu Issue related to context menu drawn by the OS

Comments

@claycoleman
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.97.2 (Universal)
  • OS Version: Mac Apple Silicon

Commit: e54c774
Date: 2025-02-12T23:20:35.343Z (2 wks ago)
Electron: 32.2.7
ElectronBuildId: 10982180
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.1.0

Steps to Reproduce:

  1. Open the Explorer tab in the sidebar.
  2. Right click a file to open the file context menu
  3. Use the arrow keys to select the option you want to execute
  4. Hit enter
  5. Watch that the option you select becomes deselected, the "Rename" option becomes selected, and then is executed.

What I Expect:
5. The option you have selected is executed.

I realize I could change the keyboard shortcut for "Rename" (it's Enter), but this used to work and it now doesn't.

Thanks so much in advance!!

@claycoleman claycoleman changed the title Context menu items don't select when Enter pressed Selected context menu item doesn't execute when Enter pressed Mar 3, 2025
@DonJayamanne DonJayamanne assigned bpasero and unassigned DonJayamanne Mar 4, 2025
@bpasero
Copy link
Member

bpasero commented Mar 4, 2025

/gifPlease

Copy link

Thanks for reporting this issue! Unfortunately, it's hard for us to understand what issue you're seeing. Please help us out by providing a screen recording showing exactly what isn't working as expected. While we can work with most standard formats, .gif files are preferred as they are displayed inline on GitHub. You may find https://gifcap.dev helpful as a browser-based gif recording tool.

If the issue depends on keyboard input, you can help us by enabling screencast mode for the recording (Developer: Toggle Screencast Mode in the command palette). Lastly, please attach this file via the GitHub web interface as emailed responses will strip files out from the issue.

Happy coding!

@vs-code-engineering vs-code-engineering bot added the info-needed Issue requires more information from poster label Mar 4, 2025
@ArturoDent
Copy link

The hotkey for Rename is F2 on my system. Did you make a keybinding change?

Also I cannot replicate your issue. Did you try an extension bisect to see if there is a conflicting extension?

@claycoleman
Copy link
Author

@ArturoDent the F2 command is actually editor.action.rename – this issue is related to renaming files in the sidebar (command renameFile), not renaming variables in the code editor.

I repro'd and reported the bug from VS Code with all extensions disabled. I also just updated to 1.98.0 and the bug still repros for me with all extensions disabled!

@claycoleman
Copy link
Author

@bpasero here is a gif screen recording, with my keystrokes displayed.

Image

@bpasero bpasero changed the title Selected context menu item doesn't execute when Enter pressed macOS: pressing Enter on visible context menu in explorer triggers "Rename" always Mar 7, 2025
@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member system-context-menu Issue related to context menu drawn by the OS labels Mar 7, 2025
@vs-code-engineering vs-code-engineering bot removed the info-needed Issue requires more information from poster label Mar 7, 2025
@bpasero
Copy link
Member

bpasero commented Mar 7, 2025

Thanks, I can reproduce now.

I am not sure how to address this though: Enter is the assigned keybinding for "Rename", as long as focus is in the explorer on an item. Even when the menu opens, we still route Enter to trigger "Rename" irrespective of the selected entry of the menu.

This is not a recent regression, I can reproduce back multiple versions.

@bpasero bpasero added the keybindings VS Code keybinding issues label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member keybindings VS Code keybinding issues system-context-menu Issue related to context menu drawn by the OS
Projects
None yet
Development

No branches or pull requests

5 participants