If you compile vim yourself, you can simply change SW_SHOWMINNOACTIVE to
SW_HIDE in https://github.com/vim/vim/blob/master/src/os_win32.c#L4131.

I have used this patch for years (unfortunately I forget the source of the
patch) then just add let $VIM_SYSTEM_HIDECONSOLE=1 to vimrc or toggle the
value when necessary.

# HG changeset patch
# Parent 0e6eb1e63bdf24b9e60221a9a8131b2307f4a2b0
# Parent  00323db61d6eb59456994fc9aa8306583263cba8

diff -r 00323db61d6e src/os_win32.c
--- a/src/os_win32.c    Tue Jul 12 11:58:21 2016 +0700
+++ b/src/os_win32.c    Tue Jul 12 11:58:22 2016 +0700
@@ -4128,7 +4128,14 @@
      * Don't activate the window to keep focus on Vim.
      */
     if ((options & SHELL_DOOUT) && !mch_windows95() && !gui_is_win32s())
-    si.wShowWindow = SW_SHOWMINNOACTIVE;
+    {
+    char *vim_system_hideconsole;
+    vim_system_hideconsole = getenv("VIM_SYSTEM_HIDECONSOLE");
+    if (vim_system_hideconsole != NULL && strcmp(vim_system_hideconsole,
"0") != 0)
+        si.wShowWindow = SW_HIDE;
+    else
+        si.wShowWindow = SW_SHOWMINNOACTIVE;
+    }
     else
     si.wShowWindow = SW_SHOWNORMAL;
     si.cbReserved2 = 0;


On Thu, Jul 14, 2016 at 3:02 PM, Linwei <[email protected]> wrote:

> Taglist (or tagbar) is the top-1 rated plugin in vim.org, many windows
> gvim users are using it in their every day work. But the system() window
> (Taglist using system() to invoke ctags.exe) will pop up on the windows
> taskbar each time when a new file is open or a file is closed, which is
> very annoying:
>
> Opening multiple files with CtrlP.vim, my laptop seems to be hacked by
> some virus:
> [image: cmdhide]
> <https://cloud.githubusercontent.com/assets/3035071/16831487/d57dc236-49d7-11e6-86cc-05296e0c030b.gif>
>
> (Taglist will generate tags for each new file if g:Taglist_Show_Menu has
> been set, Tagbar may do same thing with some necessary option).
>
> opening multiple files or open a file or close a file are frequently used
> in gvim, and many plugins may use system() a lot to invoke external
> executables. Experience of vim or gtk/gnome gvim and macvim are far more
> better than gvim on windows for a long time.
>
> As system() is a very commonly used function in many plugins.
> I wonder is there a irresistible reason to show that cmd window on windows
> taskbar ?
> Why invoking system() can be slient in other vim/gvim versions ?
> Is it possible to hide the cmd window on windows taskbar ?
> Can we choose some alternative apis like WinExec(..., SW_HIDE) to solve
> this problem ?
> Or at least can we add an option to system() on windows to use SW_HIDE ?
>
> Could system() on windows become as smooth as other versions some day ?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/vim/vim/issues/922>, .
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui