Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search web for highlighted text feature? #10175

Closed
junefranklin opened this issue May 25, 2021 · 5 comments · Fixed by #15539
Closed

search web for highlighted text feature? #10175

junefranklin opened this issue May 25, 2021 · 5 comments · Fixed by #15539
Labels
Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Milestone

Comments

@junefranklin
Copy link

junefranklin commented May 25, 2021

would be nice to highlight some terminal output and right click -> search in browser and it would just send whatever you highlighted to your default web browser.

would also be nice to have a "search stackoverflow" function, I was using google colab and when you get an error in that, it gives you a button that offers to search stackoverflow for you. might be nice to have a thing that detects text in your terminal looking like it might be an error message and offering the user a button to search web for that text. picture attached is what that looks like on colab.

image

so that button sends you here..
image

pretty simple little tool, but makes a world of difference.

Description of the new feature/enhancement

Proposed technical implementation details (optional)

@junefranklin junefranklin added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 25, 2021
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 25, 2021
@zadjii-msft
Copy link
Member

This is a neat idea for an extension, thanks!

@zadjii-msft zadjii-msft added Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels May 25, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 25, 2021
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone May 25, 2021
@DHowett DHowett added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. and removed Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 25, 2021
@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
@zadjii-msft
Copy link
Member

zadjii-msft commented Mar 22, 2022

Note

Walkthrough

Start with this branch: https://github.com/microsoft/terminal/compare/dev/migrie/fhl/10175-web-search-for-text

Anyone coming to this thread: Taking the above commit, it should be fairly trivial to get this across the finish line.

  • The TODO! in ActionArgs.h should just be removed
  • The TODO! in TerminalPage::_HandleSearchForText might be tricker - should we join the lines with spaces? How does this interact with wrapped lines? Block selection? Basically, if you have answers there, that's good enough.

@zadjii-msft zadjii-msft modified the milestones: Backlog, Terminal v1.15 Mar 23, 2022
@zadjii-msft zadjii-msft self-assigned this Jun 21, 2022
@zadjii-msft zadjii-msft modified the milestones: Terminal v1.16, Up Next Jul 11, 2022
@zadjii-msft zadjii-msft removed their assignment Jul 11, 2022
@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. good first issue This is a fix that might be easier for someone to do as a first contribution labels Jul 11, 2022
@BenConstable9
Copy link
Contributor

  • The TODO! in TerminalPage::_HandleSearchForText might be tricker - should we join the lines with spaces? How does this interact with wrapped lines? Block selection? Basically, if you have answers there, that's good enough.

Could I just trim spaces from the end of each line and join with a single space? That way all wrapped lines would unwrap and block selection.

@zadjii-msft
Copy link
Member

Could I just trim spaces from the end of each line and join with a single space? That way all wrapped lines would unwrap and block selection

That seems like a sensible default to me! Dunno why I never thought of that 😅

@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Jun 11, 2023
@mpela81
Copy link
Contributor

mpela81 commented Jun 11, 2023

Made a PR, let's see how it goes 😄

DHowett pushed a commit that referenced this issue Jun 21, 2023
This PR adds a `searchWeb` command to search the selected text on the web.
Arguments:
- `queryUrl`: URL of the web page to launch (the selected text will be
inserted where the first `%s` is found in the query string)

To make the search text more "compact" and handle multi-line selections,
I'm concatenating the selected lines and replacing consecutive
whitespaces with a single space (we may change this with something more
clever in case).

## Validation Steps Performed
Manual testing with single, multi-line, block selections.

Closes #10175

---------

Co-authored-by: Marco Pelagatti <marco.pelagatti@iongroup.com>
Co-authored-by: Mike Griese <migrie@microsoft.com>
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Jun 21, 2023
qqkookie pushed a commit to qqkookie/terminal that referenced this issue Jun 22, 2023
This PR adds a `searchWeb` command to search the selected text on the web.
Arguments:
- `queryUrl`: URL of the web page to launch (the selected text will be
inserted where the first `%s` is found in the query string)

To make the search text more "compact" and handle multi-line selections,
I'm concatenating the selected lines and replacing consecutive
whitespaces with a single space (we may change this with something more
clever in case).

## Validation Steps Performed
Manual testing with single, multi-line, block selections.

Closes microsoft#10175

---------

Co-authored-by: Marco Pelagatti <marco.pelagatti@iongroup.com>
Co-authored-by: Mike Griese <migrie@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. good first issue This is a fix that might be easier for someone to do as a first contribution Help Wanted We encourage anyone to jump in on these. In-PR This issue has a related PR Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants