SIGN IN SIGN UP

fix(rg): search piped stdin when no paths are given (#281)

When rg receives piped stdin with no explicit path arguments, it now
searches stdin instead of defaulting to the current directory. This
matches real ripgrep behavior and is consistent with how grep already
handles stdin in just-bash.

The fix checks for non-empty stdin before defaulting to ".". When stdin
has content and no paths are given, searchContent is called directly on
the stdin text with all applicable options (invert, count, context, etc).

Also fixes the existing rg.utf8-stdin test which was previously passing
by accident — it tested piped stdin but rg was actually searching the
filesystem.

Fixes #280
M
Mohan Raghu Garimella committed
ca1cf25c695ffe754bcdf7ab4bde0476073fe41a
Parent: 7a5a0b9
Committed by GitHub <noreply@github.com> on 7/8/2026, 2:27:51 PM