macOS: pressing `Enter` on visible context menu in explorer triggers "Rename" always
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.97.2 (Universal)
- OS Version: Mac Apple Silicon
Commit: e54c774e0add60467559eb0d1e229c6452cf8447 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:
- Open the Explorer tab in the sidebar.
- Right click a file to open the file context menu
- Use the arrow keys to select the option you want to execute
- Hit enter
- 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!!
/gifPlease
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!
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?
@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!
@bpasero here is a gif screen recording, with my keystrokes displayed.
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.
This is not a recent regression, I can reproduce back multiple versions.
Interesting that you say this – this had never happened to me before updating VS Code recently. I guess I didn't update VS Code for 3-6 months, it had stopped working. I could try to install different versions to trace back to the version that started this problem? Is there an easy tool to bisect across VS Code versions?
Yes:
If this is a confirmed regression, it would help to know which change caused it. We maintain a node.js based CLI tool vscode-bisect that automatically downloads and runs previous VS Code insiders and asks for each build if the issue reproduces. It takes up to 8 steps to find exactly the build that caused the regression.
Steps:
- install node.js (if not yet done)
npx --yes @vscode/vscode-bisect@latest- follow the instructions until you found the offending build (its fine to leave the commit empty)
- report back the commit range in this issue
Thanks!
hmm, i tried npx --yes @vscode/vscode-bisect@latest and got [build] All builds are bad! Try running with --releasedOnly to support older builds. – so i tried with --releasedOnly and also got to all builds are bad.
i'm beginning to believe that i am misremembering that this ever worked with Enter, but instead it works by using Space (as I have a setting on my mac that allows selected options to be selected using Tab to move and Space to select).
going to close this out as I have a workaround, unless you think there is another way to / value in testing this out further.
thanks for your help here @bpasero !