[vim] silent execution of grep (#529)

57 views
Skip to first unread message

Alberto Fanjul

unread,
Dec 13, 2015, 8:21:43 AM12/13/15
to vim/vim

Launching grep with silent is not really silent (search using vim codebase)

$ vim -e -s -c "silent grep appveyor -R *" -c 'qall!'
Filelist:8:     appveyoryml \  
READMEmd:4:[![Appveyor Build status](https://ciappveyorcom/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ciappveyorcom/project/chrisbra/vim)

I found there's no way to avoid output for ex_make (function underneath :grep), because nothing defines

https://githubcom/vim/vim/blob/5d8afebb5bf7fb1e8ce06062451dc6a1f9a53ac0/src/os_unixc#L230

show_shell_mess = FALSE;

with indeed suppress external command output for

https://githubcom/vim/vim/blob/5d8afebb5bf7fb1e8ce06062451dc6a1f9a53ac0/src/os_unixc#L4515

here:

https://githubcom/vim/vim/blob/5d8afebb5bf7fb1e8ce06062451dc6a1f9a53ac0/src/os_unixc#L4363

To be more general, I do like to have :make in real silent mode too as I relay on quickfix to navigate errors or results

calling mch_expand_wildcards

https://githubcom/vim/vim/blob/5d8afebb5bf7fb1e8ce06062451dc6a1f9a53ac0/src/os_unixc#L5676

is the only way to set show_shell_mess to FALSE,

https://githubcom/vim/vim/blob/5d8afebb5bf7fb1e8ce06062451dc6a1f9a53ac0/src/os_unixc#L6004

but really don't know where to insert such call

Is that call missing, is it planned to add?


Reply to this email directly or view it on GitHub.

Bram Moolenaar

unread,
Dec 13, 2015, 11:34:01 AM12/13/15
to vim/vim

Alberto Fanjul wrote:

> Launching grep with silent is not really silent (search using vim codebase)
>
> $ vim -e -s -c "silent grep appveyor -R *" -c 'qall!'
> Filelist:8: appveyoryml \
> READMEmd:4:[![Appveyor Build status](https://ciappveyorcom/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ciappveyorcom/project/chrisbra/vim)
>
> I found there's no way to avoid output for ex_make (function underneath :grep), because nothing defines
>
> https://githubcom/vim/vim/blob/5d8afebb5bf7fb1e8ce06062451dc6a1f9a53ac0/src/os_unixc#L230

[...]

Those links to github don't work, so I can't see what you are talking
about. Perhaps quote the relevant code?


--
hundred-and-one symptoms of being an internet addict:
266. You hear most of your jokes via e-mail instead of in person.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Alberto Fanjul

unread,
Dec 13, 2015, 9:03:06 PM12/13/15
to vim/vim

Maybe you're trying url from grep execution, (which is merely coincidence) I just look for a search with few results, say:

$ vim -e -s -c "silent grep appveyor -R *" -c 'qall!'
Filelist:8:     appveyor.yml \  
README.md:4:blablablabla

I can see a missing dot on your urls

https://githubcom/vim/vim/blob/5d8afebb5bf7fb1e8ce06062451dc6a1f9a53ac0/src/os_unixc#L230

instead of:

https://githubcom/vim/vim/blob/5d8afebb5bf7fb1e8ce06062451dc6a1f9a53ac0/src/os_unix.c#L230

anyway is plain to follow url (in case explained it is src/os_unix.c, line 230. etc etc etc)

Alberto Fanjul

unread,
Oct 22, 2017, 5:26:14 PM10/22/17
to vim/vim, Subscribed

This is about suppress output for a command. Avoid grep clear screen and show results to collect them on a quicklist, avoid make clear screen and show build output

Setting that variable to false output is not shown at all


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Tony Mechelynck

unread,
Oct 22, 2017, 6:37:59 PM10/22/17
to vim/vim, Subscribed

@brammool : Somehow a dot gets lost (between github and com) in the URL as the original post post got sent over from github to Google Groups to users' mailboxes. For best results this thread should be viewed on github.

Best regards,
Tony.

Mao-Yining

unread,
Sep 15, 2026, 9:29:00 PM (6 days ago) Sep 15
to vim/vim, Subscribed
mao-yining left a comment (vim/vim#529)

I am using Vim 9.2.1112. On both Windows and Linux's TUI. If we use silent grep or silent make. All contents on the screen will be cleared until use press <C-L> manually. Is this possible to redraw by default in this case?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/529/5690636821@github.com>

h_east

unread,
Sep 16, 2026, 11:41:29 PM (5 days ago) Sep 16
to vim/vim, Subscribed
h-east left a comment (vim/vim#529)

The blank screen is a missing redraw in do_shell(). It calls
wait_return(msg_silent == 0), and that argument is what schedules
set_must_redraw(UPD_CLEAR). Since wait_return() skips the hit-enter
prompt for :silent on its own, passing FALSE there only takes the redraw
away. Passing TRUE draws the window again, while a plain :make keeps its
prompt.

For the original request, what reaches the screen from :grep and :make is
written by the tee in the default 'shellpipe'. With set shellpipe=>%s\ 2>&1
nothing goes to the terminal and the quickfix list is filled as before, so
:silent grep is silent today.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/529/5708108821@github.com>

Reply all
Reply to author
Forward
0 new messages