Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-16 Fir de Conversatie skywind3000
char101:
> I have created a proof-of-concept plugin that hide the console window using 
> api hooking.
> 
> https://github.com/char101/vim-hidecmd/
> 

that's great !! thanks

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-16 Fir de Conversatie Charles
I have created a proof-of-concept plugin that hide the console window using
api hooking.

https://github.com/char101/vim-hidecmd/

On Fri, Jul 15, 2016 at 8:18 PM, Charles  wrote:

> An alternative way without the need to modify vim is to create an
> application that hook the CreateProcess function and modify the window
> flags. It can be written e.g. in Python using the deviare library.
>
> On Fri, Jul 15, 2016, 1:33 PM skywind3000  wrote:
>
>> Bram:
>>
>> > I'm not sure if that can be made to work.  CTRL-Break sometimes behaves
>> > strange.
>> >
>> > On Unix you would use "kill" to stop the process.  On MS-Windows you can
>> > use the task manager for this, right?
>> >
>> > In general I don't mind the flickering, it's feedback that something is
>> > happening.  (I liked to hear my harddisk rattling, to know how busy it
>> > is, SSDs broke that.  I liked to hear my modem produce noise, so that I
>> > knew what was going over the line. Now I have fiber...).
>> >
>>
>> Yes, ctrl_break is not important, we can stop process by `kill` or `task
>> manager`.
>>
>> I like the modem noise in the old days too, but these feedbacks are sound
>> feedback, not graphics feedbacks.
>>
>> We can see windows users asking for help to hide the cmd window, they
>> need to focus on editing, and solutions are everywhere including patch of
>> os_win32.c, python/perl script to emulate unix `system()` experience for
>> vim. But none of these are perfect (depend on python or need modify
>> official source code).
>>
>> Can we get the ability to choose what ever we like ?
>> Could windows gvim users have an option to enable SW_HIDE in `system()` ?
>>
>> --
>> --
>> 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 vim_dev+unsubscr...@googlegroups.com.
>> 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-15 Fir de Conversatie Charles
An alternative way without the need to modify vim is to create an
application that hook the CreateProcess function and modify the window
flags. It can be written e.g. in Python using the deviare library.

On Fri, Jul 15, 2016, 1:33 PM skywind3000  wrote:

> Bram:
>
> > I'm not sure if that can be made to work.  CTRL-Break sometimes behaves
> > strange.
> >
> > On Unix you would use "kill" to stop the process.  On MS-Windows you can
> > use the task manager for this, right?
> >
> > In general I don't mind the flickering, it's feedback that something is
> > happening.  (I liked to hear my harddisk rattling, to know how busy it
> > is, SSDs broke that.  I liked to hear my modem produce noise, so that I
> > knew what was going over the line. Now I have fiber...).
> >
>
> Yes, ctrl_break is not important, we can stop process by `kill` or `task
> manager`.
>
> I like the modem noise in the old days too, but these feedbacks are sound
> feedback, not graphics feedbacks.
>
> We can see windows users asking for help to hide the cmd window, they need
> to focus on editing, and solutions are everywhere including patch of
> os_win32.c, python/perl script to emulate unix `system()` experience for
> vim. But none of these are perfect (depend on python or need modify
> official source code).
>
> Can we get the ability to choose what ever we like ?
> Could windows gvim users have an option to enable SW_HIDE in `system()` ?
>
> --
> --
> 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 vim_dev+unsubscr...@googlegroups.com.
> 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-15 Fir de Conversatie skywind3000
Bram: 

> I'm not sure if that can be made to work.  CTRL-Break sometimes behaves
> strange.
> 
> On Unix you would use "kill" to stop the process.  On MS-Windows you can
> use the task manager for this, right?
> 
> In general I don't mind the flickering, it's feedback that something is
> happening.  (I liked to hear my harddisk rattling, to know how busy it
> is, SSDs broke that.  I liked to hear my modem produce noise, so that I
> knew what was going over the line. Now I have fiber...).
> 

Yes, ctrl_break is not important, we can stop process by `kill` or `task 
manager`.

I like the modem noise in the old days too, but these feedbacks are sound 
feedback, not graphics feedbacks. 

We can see windows users asking for help to hide the cmd window, they need to 
focus on editing, and solutions are everywhere including patch of os_win32.c, 
python/perl script to emulate unix `system()` experience for vim. But none of 
these are perfect (depend on python or need modify official source code).

Can we get the ability to choose what ever we like ?
Could windows gvim users have an option to enable SW_HIDE in `system()` ?

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-14 Fir de Conversatie Bram Moolenaar

skywind wrote:

> > I am on the fence on this one.
> > If Vim shells out to run something and that something is taking a _very_ 
> > long time, your Vim is essentially hung.
> > This happens to me frequently.
> > At least with the Window there, I can close it, which returns an error to 
> > Vim (via the system() call) and I get my Vim back.
> > Without that I have to terminate Vim, and that is a real pain.
> > 
> > David 
> --
> So, how can you stop these __very__ long time tasks from non-windows
> platform, which won't pop up a cmd window ?
> 
> __very__ long time tasks are supposed to be launched via async jobs in
> the latest vim version.
> 
> Could windows gvim stop the child processes by a Ctrl_C/Ctril_Break ?
> 
> There is an internal win32 message loop at line 4159 of os_win32.c:
> 
> https://github.com/vim/vim/blob/master/src/os_win32.c#L4159
> 
> which is used to update gui while waiting for child process finished.
> 
> Can we add a Ctrl_C/Ctrl_Break detection there to allow user stop a
> long time running process ? 
> 
> (I haven't read the whole part of os_win32.c, just do some search and
> find this
> routine.)
> 
> If the child processes of 'system()' could be stop by
> ctrl_break/ctrl_c, could we make `system()` act the same way to the
> other vim versions ?

I'm not sure if that can be made to work.  CTRL-Break sometimes behaves
strange.

On Unix you would use "kill" to stop the process.  On MS-Windows you can
use the task manager for this, right?

In general I don't mind the flickering, it's feedback that something is
happening.  (I liked to hear my harddisk rattling, to know how busy it
is, SSDs broke that.  I liked to hear my modem produce noise, so that I
knew what was going over the line. Now I have fiber...).

-- 
### Hiroshima 45, Chernobyl 86, Windows 95 ###

 /// Bram Moolenaar -- b...@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///

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-14 Fir de Conversatie skywind3000
> I am on the fence on this one.
> If Vim shells out to run something and that something is taking a _very_ long 
> time, your Vim is essentially hung.
> This happens to me frequently.
> At least with the Window there, I can close it, which returns an error to Vim 
> (via the system() call) and I get my Vim back.
> Without that I have to terminate Vim, and that is a real pain.
> 
> David 
--
So, how can you stop these __very__ long time tasks from non-windows platform, 
which won't pop up a cmd window ?

__very__ long time tasks are supposed to be launched via async jobs in the 
latest vim version.

Could windows gvim stop the child processes by a Ctrl_C/Ctril_Break ?

There is an internal win32 message loop at line 4159 of os_win32.c:

https://github.com/vim/vim/blob/master/src/os_win32.c#L4159

which is used to update gui while waiting for child process finished.

Can we add a Ctrl_C/Ctrl_Break detection there to allow user stop a long time 
running process ? 

(I haven't read the whole part of os_win32.c, just do some search and find this
routine.)

If the child processes of 'system()' could be stop by ctrl_break/ctrl_c, could 
we make `system()` act the same way to the other vim versions ?







-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-14 Fir de Conversatie David Fishburn
On Thu, Jul 14, 2016 at 4:02 AM, Linwei  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:
>
> 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 ?
>

I am on the fence on this one.
If Vim shells out to run something and that something is taking a _very_
long time, your Vim is essentially hung.
This happens to me frequently.
At least with the Window there, I can close it, which returns an error to
Vim (via the system() call) and I get my Vim back.
Without that I have to terminate Vim, and that is a real pain.

David

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-14 Fir de Conversatie Charles
On Thu, Jul 14, 2016 at 4:45 PM, Linwei  wrote:

> Will the official gvim adopt this important patch ?
> Patching each new release myself is really awful.
>

It's quite effortless if you use the hg mirror and maintain the patches
with mq. Then to update to new version just run

hg qpop -a
hg update
hg qpush -a

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Is it very difficult to hide cmd window when calling 'system()' on windows ? (#922)

2016-07-14 Fir de Conversatie Charles
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.cTue Jul 12 11:58:21 2016 +0700
+++ b/src/os_win32.cTue 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  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]
> 
>
> (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
> , .
>
> --
> --
> 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 vim_dev+unsubscr...@googlegroups.com.
> 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.