Skip to content

[Feature Request] Automatically highlight matching occurrences on mouse double-click / text selection #20842

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

  1. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Oct 23, 2026
  2. added
    Needs-Tag-FixDoesn't match tag requirements
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Oct 23, 2026
  3. j4james commented on Oct 27, 2026

    @j4james
    Collaborator

    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:

    • Alt+8 will color the selected text in yellow.
    • Alt+Shift+8 will color the selected text, as well as any other matching occurrences of that text.

    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.

  4. thernstig commented on Oct 27, 2026

    @thernstig
    Author

    That sounds like a great entry point in the code to re-use to build something like this.

  5. rorieaniston26 commented on Nov 2, 2026

    @rorieaniston26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Needs-Tag-FixDoesn't match tag requirementsNeeds-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions