1

I'm using GitBash on Windows 10. I want to use the silver searcher (ag), which I have used on *-nix systems and I have this installed in GitBash

$ ag --version
ag version 2.2.5 ; Windows port 2021-06-04 Win64 >= Server2003 amd64
MsvcLibX 2021-06-03 ; PCRE 8.44 2020-02-12 ; pthreads4w 3.0.0 ; zlib 1.2.11

Features:
  +jit -lzma +zlib +2enc

However, when I use the utility in GitBash, it doesn't print out the file in which the search string occurs,

$ echo 'hello' > /tmp/file

MYUSER@ABCDEf XYZGW64 ~/Documents/workspace/finance-uimodule-customersetup (dev/POAWS-3048_part2)
$ ag 'hello' /tmp
hello

How do I configure silver searcher (ag) so that when I do a search it prints out the file where the actual string occurs?

1 Answer 1

1

Try wrapping it with the winpty command:


    winpty ag 'hello' /tmp

Ref.: https://gist.github.com/DeanPDX/acff533cff0cfbda2761d1e62e8cb1a7#getting-npm-colors--progress-working

2
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Apr 24, 2023 at 23:16
  • 2
    Please explain the command with your words instead of just linking a random page thatmay disappear whenever.
    – Destroy666
    Commented Apr 24, 2023 at 23:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .