fix: allow Find in Files hotkey to work after closing a script tab#1745
Merged
willeastcott merged 3 commits intomainfrom Feb 12, 2026
Merged
fix: allow Find in Files hotkey to work after closing a script tab#1745willeastcott merged 3 commits intomainfrom
willeastcott merged 3 commits intomainfrom
Conversation
When a script tab is closed, the code panel is hidden with visibility: hidden but Monaco's internal textarea retains DOM focus. This causes the global hotkey system to ignore Ctrl+Shift+F since it skips events targeting textarea elements. Blur the active element when hiding the code panel so the global hotkey handler can receive keyboard events. Also guard against a null model in picker:search:open to prevent errors when no document is open. Fixes #1730 Co-authored-by: Cursor <cursoragent@cursor.com>
kpal81xd
approved these changes
Feb 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the “Find in Files” global hotkey (Ctrl+Shift+F) becoming unresponsive after closing the last script tab by ensuring Monaco’s hidden textarea doesn’t retain focus, and hardens search picker behavior when no document/model is open.
Changes:
- Blur the currently focused element inside the code panel when the code panel is hidden (
toggleCode(false)), so global hotkeys are not ignored due to textarea targeting. - Add a guard around
monacoEditor.getModel()before deriving a search value from the current selection. - (As part of the above) avoid errors when opening search with no active document.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/code-editor/pickers/picker-search.ts | Adds model guard before using selection text as the default search value. |
| src/code-editor/monaco/monaco.ts | Blurs focused element when hiding the code panel to restore global hotkey handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
visibility: hiddenbut Monaco's internal<textarea>retains DOM focustoggleCode(false)is called, so the global hotkey handler can receive keyboard eventspicker:search:opento prevent errors when no document is openFixes #1730
Test Plan