Often when I have the Test Explorer pane open, and am typing in a file editor, the Filter pane in the Test Explorer will suddenly gain focus and my keystrokes are sent there.
Steps to Reproduce
I’m uncertain if it only repros while I’m stopped at a breakpoint while debugging a test. I’m uncertain if it only repros when I save a test file.
I know it does not always repro with either of the above. It seems to happen ~randomly. I do not believe a special keyboard binding has been triggered, as it often happens when typing unmodified characters alone.
While typing up this bug report, and failing to repro it, I switched back to Cursor and noticed that the Filter input was focused.
Expected Behavior
Keyboard focus should remain in the area I’m typing, not switch.
Operating System
Windows 10/11
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
“Consistently” is hard to say; I don’t have specific repro steps yet. However, coworkers with both macOS and Windows are experiencing this.
Which Test Explorer are you using and which test runner/extension is active (e.g., Jest, Vitest, Python, etc.)?
I was unaware that there are multiple Test Explorers; I’m referring to the built-in “Test Explorer” pane in the sidebar, with the Erlenmeyer flask icon. It is a Python-based project we’re working on, using Pytest. Here are the installed extensions:
Try with extensions disabled: launch Cursor from the terminal with cursor --disable-extensions and let me know if it still reproduces
This will be hard to do, as it’s hard to reproduce normally, and working extensively without these extensions is generally infeasible.
Open Help > Toggle Developer Tools, go to the Console tab, collect logs at the moment focus jumps, and attach them
Will do.
As a temporary workaround, try closing or minimizing the Test Explorer and tell me if the issue disappears. Let me know if that helps.
This is known to be fine. Neither I nor coworkers have experienced this problem when the Test Explorer is not visible in the sidebar. It only occurs when the Test Explorer is open.