Repository navigation
Description
Description of the new feature
I think this would be a cool addition to the Windows Terminal.
When a user double-clicks a word or manually highlights a text string using the mouse cursor, Windows Terminal should automatically highlight all identical occurrences of that word/string currently visible within the viewport (and optionally across the active scrollback buffer).
This behavior is standard in modern text editors and IDEs. I use it as a powerful tool for visual log analysis and tracing variable occurrences in terminal output etc.. Without having to explicitly invoke a separate search dialog.
https://code.visualstudio.com/docs/editing/codebasics#_multiple-selections-multi-cursor and the images there show how it looks when selecting shows how this looks. The cool thing here is that even selects along editors, so I think a feature request here could also do the same amongst panes in the current tab. Maybe put that behind a setting.
Proposed Behavior
- Trigger: Double-clicking a word or selecting a specific text string with the mouse cursor.
- Action: All matching instances of that string within the terminal's visible buffer instantly receive a subtle background highlight or outline color.
- Dismissal: Clicking anywhere else to clear the text selection immediately clears all secondary highlights.
- Configurability: Introduce a setting (e.g.,
"experimental.highlightSelectionMatches": true) to enable or disable this behavior.
I am unsure what color it should use. Maybe some "tint" of some background color, or whatever.
VS Code also has two options in reality. Words get highlighted when just the cursor is between characters in a word. It does another highlighting if double-clicking to select a full word (or sentence). Maybe both should exist as well in Windows Terminal.
I asked an AI about potential problems about this, and it said:
Technical / Performance Considerations
Terminals handle rapidly streaming text buffers differently than rigid text editors. To protect performance and minimize lag:
- The match-scanning could be strictly limited to the active viewport lines rather than scanning millions of lines in the deep scrollback buffer.
- The feature can be debounced so that the re-scan doesn't trigger continuously during an active drag-selection gesture, but rather when the mouse button is released (
WM_LBUTTONUP).
Proposed technical implementation details
No response
Activity
j4james commentedon Oct 27, 2026
You can achieve something similar to this with the existing color selection feature. Under the Interaction section of the settings, there is an option labelled Add key bindings for colored text selection. If you turn that on, it'll activate a bunch of key bindings for coloring the selected text. For example:
Different numbers give you different colors. I think you can also customize the bindings to setup your own preferred key combinations, but you might need to go into the JSON settings for that. You can find more info in PR #13429 where the feature was added.
thernstig commentedon Oct 27, 2026
That sounds like a great entry point in the code to re-use to build something like this.
rorieaniston26 commentedon Nov 2, 2026