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

Grep for Windows #1045

Open
andro23 opened this issue Jan 6, 2020 · 9 comments
Open

Grep for Windows #1045

andro23 opened this issue Jan 6, 2020 · 9 comments
Labels
Idea-New PowerToy Suggestion for a PowerToy

Comments

@andro23
Copy link

andro23 commented Jan 6, 2020

It would be great if PowerToys can include a tool to grep files such as GrepWin having a context menu option to Grep files in the selected folders.

@crutkas crutkas added the Idea-New PowerToy Suggestion for a PowerToy label Jan 6, 2020
@jcotton42
Copy link

If we're going to do this I vote it should be powered by ripgrep

@cloudhan
Copy link
Contributor

You just use PowerShell :)

gci -Recurse | sls <you regex pattern>

@andro23
Copy link
Author

andro23 commented Jan 21, 2020

It seems that gci just searches file names. The idea is to be able to search file contents using regular search and regex through a graphical user interface.

@cloudhan
Copy link
Contributor

you should try it before comment. But powertoys deserves a GUI tool like this, because not all users are comfortable with command line.

@crutkas crutkas added this to the Suggested Ideas milestone Mar 9, 2020
@mrlacey
Copy link

mrlacey commented Jun 10, 2020

I've been thinking a bit about this, but currently have only more questions:

  • Could it be based on top of an existing command-line exe? (The basics may work but getting progress--i.e. not having to wait for it to finish--may be harder.)
  • As grep is available in WSL(2) could it sit on top of that? (Although I don't know if wanting a dependency on WSL is desirable)
  • Grep has lots of options and I haven't seen any existing apps do a good job of exposing all the options in a clean and easy-to-use way. Are all options needed? (At least in a first version.)
  • Would starting with a pared-back (limited) set of options be acceptable? (And if so, which options are the minimum required?)
  • What shell integration is required? (Just an additional context menu entry in explorer, or anything more?)
  • If this brings grep support to windows, should it also support operation from the command-line and the same command-line switches as the *NIX version? (and if so, should the exe be called 'grep' or something else, or something else and also have an additional alias to 'grep.exe'?)

@andro23
Copy link
Author

andro23 commented Jun 12, 2020

  • Definitely it could be based on an existing command-line tool. No need to reinvent the wheel.
  • Depending on WSL can be a way to do it but it would be better if there is another way to implement it without having to depend on WSL. How about reusing the regex engine built-into VS Code and exposing it more in a GUI way?
  • I rarely use advanced features of Grep, at least when searching for text or patterns in a set of files. I usually right-click on a folder and launch a GUI tool that lets me search for text or basic regex having the option to include and exclude files. So, I guess for a first version, basic options would be very helpful. More options can be added later when the need arises.
  • A limited set of options will be very helpful. Some of the great options would be searching using text(case sensitive vs case insensitive) or regex, include and exclude files and folders (probably using a graphical tree at first and adding an option to use regex later), an option to look into subfolders enabled by default, filtering by file size (usually to discard huge files) and filtering by date (before, after or between a date range).
  • In my opinion, a context-menu option will do the job
  • If we are looking into porting grep to Windows, it would be good to have a seamless experience starting from having a command-line tool called "grep" which would accept the same switches as the original yielding the same results. Although, I am not sure if there is a need to port it.

@jcotton42
Copy link

iirc the VSCode engine is ripgrep

@mrlacey
Copy link

mrlacey commented Jun 15, 2020

iirc the VSCode engine is ripgrep

VSCode doesn't show any indication of [currently] taking a dependency on ripgrep and includes its own, simple grep method that while basic is enough for their needs.

@mrlacey
Copy link

mrlacey commented Sep 8, 2020

https://github.com/microsoft/PowerToys/issues/6388#issue-693491250 asks if this is the same as PowerRename?

It's not.

This is about having a separate tool that can be used to search within files. It's a UI on top of a grep utility (similar to FINDSTR).
Think of it as "Find in files" but as a standalone tool.
As linked above, there are some 3rd party tools that already provide this functionality but these are often available from questionable sources, are not clearly maintained, and have out-dated UIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea-New PowerToy Suggestion for a PowerToy
Projects
None yet
Development

No branches or pull requests

5 participants