Why can't ripgrep search the output of a Write-Host
command on Windows?
#2892
-
Please tick this box to confirm you have reviewed the above.
What version of ripgrep are you using?ripgrep 14.1.1 (rev 4649aa9) How did you install ripgrep?scoop What operating system are you using ripgrep on?Windows 11, PowerShell 7.4.2 Describe your bug.ripgrep does not read stdin from Write-Host What are the steps to reproduce the behavior?02:05 ~ 02:06 ~ 02:06 ~ 02:06 ~ 02:07 ~ What is the actual behavior?ripgrep does not read stdin from Write-Host What is the expected behavior?ripgrep should work on Write-Host |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
What happens if you do My guess is that Write-Host isn't writing to stdout. Which means this is expected behavior. But I'm not familiar with Windows too much and I don't know what Write-Host is. Maybe you can do some debugging by comparing with other tools. |
Beta Was this translation helpful? Give feedback.
-
=> ripgrep can't work with |
Beta Was this translation helpful? Give feedback.
Write-Host writes directly to PowerShell (the host), skipping the pipeline (stdin/stdout).
Write-Output writes to the pipeline (stdout), and
echo
is an alias to it.=> ripgrep can't work with
Write-Host
, as it does…