Skip to content

Commit

Permalink
doc: document cygwin path translation behavior
Browse files Browse the repository at this point in the history
Kudos to @Pyker for posting more details about this.

Closes #1277
  • Loading branch information
BurntSushi committed Sep 13, 2020
1 parent 11c7b2a commit e6e5005
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ TBD
===
Unreleased changes. Release notes have not yet been written.

Bug fixes:

* [BUG #1277](https://github.com/BurntSushi/ripgrep/issues/1277):
Document cygwin path translation behavior in the FAQ.


12.1.1 (2020-05-29)
===================
Expand Down
21 changes: 21 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [How do I configure ripgrep's colors?](#colors)
* [How do I enable true colors on Windows?](#truecolors-windows)
* [How do I stop ripgrep from messing up colors when I kill it?](#stop-ripgrep)
* [Why does using a leading `/` on Windows fail?](#because-cygwin)
* [How can I get results in a consistent order?](#order)
* [How do I search files that aren't UTF-8?](#encoding)
* [How do I search compressed files?](#compressed)
Expand Down Expand Up @@ -315,6 +316,26 @@ available
[here](https://github.com/BurntSushi/ripgrep/issues/281#issuecomment-269093893).


<h3 name="because-cygwin">
Why does using a leading `/` on Windows fail?
</h3>

If you're using cygwin on Windows and try to search for a pattern beginning
with a `/`, then it's possible that cygwin is mangling that pattern without
your knowledge. For example, if you tried running `rg /foo` in a cygwin shell
on Windows, then cygwin might mistakenly perform path translation on `/foo`,
which would result in `rg C:/msys64/foo` being searched instead.

You can fix this in one of three ways:

1. Stop using cygwin.
2. Escape the leading slash with an additional slash. e.g., `rg //foo`.
3. Temporarily disable path translation by setting `MSYS_NO_PATHCONV=1`. e.g.,
`MSYS_NO_PATHCONV=1 rg /foo`.

For more details, see https://github.com/BurntSushi/ripgrep/issues/1277


<h3 name="size-limit">
How do I get around the regex size limit?
</h3>
Expand Down

0 comments on commit e6e5005

Please sign in to comment.