Hi,
2019/5/23 Thu 9:36:27 UTC+9 Ken Takata wrote:
> That's too bad.
> Unfortunately, I cannot repoduce this yet.
> Does this simple case work?
>
> gvim --clean
> :echo system('dir')
>
> Does the problem occur only with gvim? not on vim.exe?
Ah! `gui.in_use` is not set when system() is executed from _vimrc.
How about the attached patch?
Regards,
Ken Takata
--
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/c4ed0550-02c0-45c9-9577-9a23dfe18f2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/os_win32.c b/src/os_win32.c
index 54ca4de7d..1320981f5 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4500,7 +4500,7 @@ mch_system_c(char *cmd, int options)
mch_system(char *cmd, int options)
{
#ifdef VIMDLL
- if (gui.in_use)
+ if (gui.in_use || gui.starting)
return mch_system_g(cmd, options);
else
return mch_system_c(cmd, options);
@@ -4821,7 +4821,7 @@ mch_call_shell(
{
cmdlen =
#ifdef FEAT_GUI_MSWIN
- (gui.in_use ?
+ (gui.in_use || gui.starting ?
(!s_dont_use_vimrun && p_stmp ?
STRLEN(vimrun_path) : STRLEN(p_sh) + STRLEN(p_shcf))
: 0) +
@@ -4834,7 +4834,7 @@ mch_call_shell(
#if defined(FEAT_GUI_MSWIN)
if (
# ifdef VIMDLL
- gui.in_use &&
+ (gui.in_use || gui.starting) &&
# endif
need_vimrun_warning)
{
@@ -4853,7 +4853,7 @@ mch_call_shell(
}
if (
# ifdef VIMDLL
- gui.in_use &&
+ (gui.in_use || gui.starting) &&
# endif
!s_dont_use_vimrun && p_stmp)
/* Use vimrun to execute the command. It opens a console
@@ -4865,7 +4865,7 @@ mch_call_shell(
p_sh, p_shcf, cmd);
else
# ifdef VIMDLL
- if (gui.in_use)
+ if (gui.in_use || gui.starting)
# endif
vim_snprintf((char *)newcmd, cmdlen, "%s %s %s %s %s",
p_sh, p_shcf, p_sh, p_shcf, cmd);
@@ -4889,7 +4889,7 @@ mch_call_shell(
/* Print the return value, unless "vimrun" was used. */
if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent
#if defined(FEAT_GUI_MSWIN)
- && (gui.in_use ?
+ && (gui.in_use || gui.starting ?
((options & SHELL_DOOUT) || s_dont_use_vimrun || !p_stmp) : 1)
#endif
)