5

When clicking on a file from the Explorer View, VSCode doesn't give focus to the file, so you then need to click inside that file to start typing. I'm pretty sure it was different before, and it would automatically give focus to the text editor.

Any idea if some option can be set to restore the old behaviour?

5
  • You could try to : (1) Disable all extensions to eliminate them as the cause, (2) Revert to an older VSCode version where it works and file a bug report.
    – harrymc
    Commented Feb 22, 2023 at 9:58
  • Ok found the GitHub issue: github.com/microsoft/vscode/issues/166118
    – laurent
    Commented Feb 22, 2023 at 14:45
  • I saw this too, where it said the fix is for Jan 2, 2023. It's long past now, but you can still vote for it.
    – harrymc
    Commented Feb 22, 2023 at 14:48
  • The most annoying thing about this problem for me is, after opening a file, I usually start by doing ctrl-f to search for something in that file. When I look up at the screen, I saw the search was executed in the file browser instead and not the file that I just opened! Not focusing on the file after opening a file is a UX fail. Commented Apr 11 at 12:33
  • @GuillaumeBois, this solution might work for this. Ever since I've setup this shortcut this bug no longer annoys me, because I was also very often pressing "ctrl+f" when opening a file which would search from their stupid file list search box instead of the file.
    – laurent
    Commented Apr 11 at 12:42

2 Answers 2

3
+100

This feature was requested in several posts and was accepted by the developers.

The latest request dates from Nov 11, 2022 : Setting to focus editor on mouse click #166118. It was accepted on Jan 2, 2023, and will be implemented sometimes in the future.

You will need to keep on installing the latest versions of VSCode as they come out, in the hope that the fix will arrive soon enough.

1

It's been more than one year that they broke this feature and it's still not fixed. The GitHub issue however mentions a possible fix, which will be good enough for some users:

  1. Launch VS Code
  2. From the "Code" menu, choose "Settings" --> "Keyboard Shortcuts".
  3. In the window that appears, search for: "Command+F"
  4. Locate the "list.find" line and right-click and remove the keybinding.
  5. Test it for yourself. Click to make the focus the a file in the file list and hit "Command+F" and it will search in the editor, not the file list.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .