Search query persistence is inconsistent across file switches
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Does this issue occur when all extensions are disabled?: Yes/No
VS Code Version: 1.134.0
OS Version: Sonoma 14.0 (23A344)
When performing a search (Cmd+F) in different files, the find widget seems to preserve the query from the first file even after switching to another file, instead of being empty or showing the last used query for that specific file.
1. Open file A.ts.
2. Press Cmd+F to open the find widget.
3. Type something into the search input (e.g., "test").
4. Close the find widget.
5. Navigate to another file (e.g., by following a link to B.ts).
6. In B.ts, press Cmd+F to open the find widget.
7. Type a different word that exists in B.ts (e.g., "example"), find it, and close the find widget.
8. Close the B.ts file.
9. Switch back to the first file (or re‑open A.ts).
10. Press Cmd+F again.
Actual result:
The find widget shows the query that was used in A.ts, but it should either be empty or preserve the last search term used in that specific file.
https://github.com/user-attachments/assets/67b949bd-8122-4629-bcae-e661d0ef79ef
Expected result:
Each file should have its own search history, or at least the find widget should not carry over a query from a different file.
Ideally, the widget should either:
- Keep the last query used in the current file (per‑file memory), or
- Start empty when opening the find widget in a new file, or
- if the search is intended to be global, the state should preserve the most recent query.
The current behavior is confusing because the user expects the search input to reflect the context of the current file or global state.
Contributor guide
Assessment
This issue has not been assessed yet.