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

memo grep won't work well with Select-String on Windows Powershell #56

Closed
squeuei opened this issue Dec 29, 2022 · 2 comments · Fixed by #57
Closed

memo grep won't work well with Select-String on Windows Powershell #56

squeuei opened this issue Dec 29, 2022 · 2 comments · Fixed by #57

Comments

@squeuei
Copy link
Contributor

squeuei commented Dec 29, 2022

memo g command causes a loop of displaying results when grepcmd is set as below.

grepcmd = "powershell Select-String -Pattern ${PATTERN} -Path ${DIR}/*.md"
  • OS: Windows 10 Pro / Windows 11 Pro
  • Terminal: Powershell on Windows Terminal

On line 720 of main.go, func cmdGrep has a if block for Windows environment and it seems to be the cause. I don't know why the block is there but I imagine that it's necessary workaround when grep is used on cmd.exe.
Actually, I'm not using grep despite the name of config so that it is very understandable if this issue is regarded as inappropriate. However I would be happy if I can use Select-String here because powershell commands are available on Windows 10/11 by default.
Is there any good way to support both grep and Select-String?

@mattn
Copy link
Owner

mattn commented Dec 29, 2022

Could you please try #57 ?

@squeuei
Copy link
Contributor Author

squeuei commented Dec 29, 2022

Tried go install github.com/mattn/memo@fix-56 and it worked flawlessly. I appreciate your quick response, and of course providing this nice tool.
Happy holidays!

@squeuei squeuei closed this as completed Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants