Skip to content

Suggestions: Add scroll back as suggestion source. #19061

Description

@e82eric

Description of the new feature

This is based on Vim's out of the box completions where it sources the options from words in the open buffers. In this case it would pull the options from the active terminal buffer.

The case where I have found this really useful is when I have run a command that returns some data and now want to use part of the result in my next command. Ex. After running git log, running an additional command on one of the hashes and being able to auto complete it. Or After running --help on a command and then being able to auto complete the options.

Being able to define a regex for the filter was really useful to be able to have targeted completions for common stuff (hashes, addresses, command line flags) and then a catch all "default" one for words with > 4 chars.

Example Config.

        {
            "command": 
            {
                "action": "showSuggestions",
                "source": "scrollback",
                "regex": "[^\\s]{5,}"
            },
            "id": "User.showSuggestions.2F7A7303"
        },
        {
            "command": 
            {
                "action": "showSuggestions",
                "source": "scrollback",
                "regex": "-{1,2}\\w(?:[\\w+|-])+"
            },
            "id": "User.showSuggestions.2F7A7304"
        },
        {
            "command":
            {
                "action": "showSuggestions",
                "source": "scrollback",
                "regex": "\\b(?:0x)?[0-9A-Fa-f]{8,16}(?:`[0-9A-Fa-f]{1,16})?|\\b[0-9A-Fa-f]{7,40}\\b"
            },
            "id": "User.showSuggestions.2F7A7305"
        },

This what it looked like when I was testing what I had hacked together locally.

Scrollback.mp4

Proposed technical implementation details

No response

Activity

  1. added theissue type on Jun 22, 2025
  2. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Jun 22, 2025
  3. added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    Needs-Tag-FixDoesn't match tag requirements
    on Jun 22, 2025
  4. changed the title [-]Add scroll back as suggestion source.[/-] [+]Feature Request. Add scroll back as suggestion source.[/+] on Jun 22, 2025
  5. changed the title [-]Feature Request. Add scroll back as suggestion source.[/-] [+]Suggestions: Add scroll back as suggestion source.[/+] on Jul 2, 2025
  6. DHowett commented on Jul 2, 2025

    @DHowett
    Member

    To quote Leonard Hecker (@lhecker), "This is disgusting in a good way"

    We love it.

  7. zadjii-msft commented on Jul 2, 2025

    @zadjii-msft
    Member

    Yea this is super cool. I think a spec in the past called out "words from the buffer", but by god I can't find that spec now. And the regex matching? WAY cooler than anything I had come up with for that.

    Assuming that this does regex smartly enough, then I'd ship the shit out of this (and I haven't even been on the terminal in like 10 months 😝)

  8. added
    Help WantedWe encourage anyone to jump in on these.
    Area-SuggestionsAnything related to tasks or the suggestions UI (sxnui)
    and removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jul 2, 2025
  9. e82eric commented on Jul 3, 2025

    @e82eric
    ContributorAuthor

    thank you guys! will start cleaning up what I have locally.

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

    Area-SuggestionsAnything related to tasks or the suggestions UI (sxnui)Help WantedWe encourage anyone to jump in on these.Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions