microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.41k stars 28.1k forks source link

Right-click menu in file explorer operates on open file instead of file that was right-clicked #211806

Open onlywei opened 2 months ago

onlywei commented 2 months ago

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

Steps to Reproduce:

  1. Open any file in VSCode
  2. Right-click on a different file in the file explorer.
  3. Click "delete"
  4. Notice that the file being deleted is the one that is currently open, not the one that was right-clicked on.
lramos15 commented 2 months ago

I cannot repro this. Can you include a screen recording / gif

onlywei commented 2 months ago

Here is a screen recording:

https://github.com/microsoft/vscode/assets/1470998/a781951b-c490-4324-8ab1-65685dec1911

OTonGitHub commented 2 months ago

I had this issue on Mac too, at the time I though it's because of 2 finger tapping to open context menu in Mac. Doesn't happen on windows.

lramos15 commented 2 months ago

It's odd, because on my mac right click also focuses the element.

I'm using the track pad.

onlywei commented 2 months ago

I'm not using a trackpad. I'm using a mouse.

onlywei commented 2 months ago

This is no longer happening to me on v1.89.0.

tianyizheng02 commented 2 months ago

This bug still occurs for me on 1.89.0 (macOS Ventura 13.6.5, all extensions disabled, using trackpad), specifically when I'm using a split editor and one of the panes is a PDF. In my screen-recorded demo below, this buggy behavior occurs when one pane displays a PDF but not when both panes are displaying text files.

https://github.com/microsoft/vscode/assets/52298854/f9f7cf6b-d096-4dfd-90e9-4417fefa91d1

Aesonus commented 1 month ago

When I am using on Windows, this issue occurs too. It occurs when trying to right click any file/folder that is not currently selected in the explorer, and applies to any operation in the file explorer including rename, new file, new folder, etc.

EDIT: From the comment above, it appears that any time that a preview is open (pdf, rst, html, etc) this issue occurs. If I have no preview open, the right click menu behaves as expected.

tianyizheng02 commented 4 weeks ago

This bug still occurs for me on v1.90.0. @lramos15, were you ever able to reproduce this?

JEBoothjr commented 2 weeks ago

Exact same issue here on Mac. Any behavior after right clicking is applied to the originally selected file. When something in the tree is selected and you right-click on another file/folder to delete, copy, paste, open terminal etc the focus jumps back to original file. I just discovered that it take 2 right-clicks to get it to focus correctly. I've accidently deleted files because of this, ran commands in wrong folders, etc. Its a serious impact to my workflow.

tianyizheng02 commented 1 week ago

Looks like this bug won't be fixed in the June 2024 update either. @lramos15, do you need us to provide any more evidence to get this bug confirmed?


Exact same issue here on Mac. Any behavior after right clicking is applied to the originally selected file...

For me, this bug only seems to occur when I have a preview (e.g., PDF) open. @JEBoothjr, is this also the case for you? Or does this bug occur for you with all file types?

lramos15 commented 1 week ago

I can confirm the bugs occurs when a preview is open. I can also confirm it regressed somewhere between 1.87 and 1.88.

Now I must track down what commit caused the regression