asyncrun.vim icon indicating copy to clipboard operation
asyncrun.vim copied to clipboard

AsyncRun ag in windows10 has no output

Open lymslive opened this issue 5 years ago • 6 comments

I've used asyncrun.vim in linux vim, now I have to use gvim in windows10.

Environment:

  • windows10,
  • gvim8.1
  • ag, rg have install in system $PATH
  • maybe relate vim options: &shell is default to 'cmd.exe', &shellcmdflag is /d /s /c

Problem: In gvim execute :AsyncRun ag --version and :AsyncRun ag --help has correct output in quickfix window, just as execute ag --version or ag --help directly in cmd.exe or powershell(or gitbash) prompt window. But when I want to search something in one code project, such as :AsyncRun ag function, the quickfix window only result in [Finished in 0 seconds with code 1], which seems fail to search, while in cmd.exe prompt `ag function' can print out some search output.

lymslive avatar Oct 29 '19 05:10 lymslive

later I've try out use AsyncRun ag function . can work, must explicitly provide . as current directory argument. That's different from the default behavior when run ag/rg directly in shell/cmd.exe

lymslive avatar Oct 31 '19 00:10 lymslive

because stdin has been closed by default

skywind3000 avatar Oct 31 '19 03:10 skywind3000

because stdin has been closed by default

Why do you make such a setting? What's the benefit?I want to know the reason.3Q

gVimer avatar May 24 '20 09:05 gVimer

I add "." to the ag command, but I cannot jump to the result in quickfix window. all result start with || , any ideas? image

gukz avatar Dec 07 '20 01:12 gukz

你要找找 ag 的参数,让它输出成:

文件名:行号:  内容

这样的 grep 格式,才能捕获。

skywind3000 avatar Dec 07 '20 02:12 skywind3000

@skywind3000 Great help!!! I add --vimgrep to the ag command and everything works!!

gukz avatar Dec 20 '20 05:12 gukz