0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.1.1492: MS-Windows: when "!" is in 'guioptions' ":!start" fails

Problem:    MS-Windows: when "!" is in 'guioptions' ":!start" fails.
Solution:   Do not use a terminal window when the shell command begins with
            "!start". (Yasuhiro Matsumoto, closes #4504)
This commit is contained in:
Bram Moolenaar
2019-06-08 12:05:22 +02:00
parent 6064073841
commit 7c348bb5ad
3 changed files with 24 additions and 8 deletions

View File

@@ -3251,7 +3251,11 @@ call_shell(char_u *cmd, int opt)
/* The external command may update a tags file, clear cached tags. */ /* The external command may update a tags file, clear cached tags. */
tag_freematch(); tag_freematch();
if (cmd == NULL || *p_sxq == NUL) if (cmd == NULL || *p_sxq == NUL
#if defined(FEAT_GUI_MSWIN) && defined(FEAT_TERMINAL)
|| vim_strchr(p_go, GO_TERMINAL) != NULL
#endif
)
retval = mch_call_shell(cmd, opt); retval = mch_call_shell(cmd, opt);
else else
{ {

View File

@@ -4640,20 +4640,30 @@ mch_call_shell(
} }
#endif #endif
#if defined(FEAT_GUI) && defined(FEAT_TERMINAL) #if defined(FEAT_GUI) && defined(FEAT_TERMINAL)
/* TODO: make the terminal window work with input or output redirected. */ // TODO: make the terminal window work with input or output redirected.
if ( if (
# ifdef VIMDLL # ifdef VIMDLL
gui.in_use && gui.in_use &&
# endif # endif
vim_strchr(p_go, GO_TERMINAL) != NULL vim_strchr(p_go, GO_TERMINAL) != NULL
&& (options & (SHELL_FILTER|SHELL_DOOUT|SHELL_WRITE|SHELL_READ)) == 0) && (options & (SHELL_FILTER|SHELL_DOOUT|SHELL_WRITE|SHELL_READ)) == 0)
{ {
/* Use a terminal window to run the command in. */ char_u *cmdbase = cmd;
x = mch_call_shell_terminal(cmd, options);
// Skip a leading quote and (.
while (*cmdbase == '"' || *cmdbase == '(')
++cmdbase;
// Check the command does not begin with "start "
if (STRNICMP(cmdbase, "start", 5) != 0 || !VIM_ISWHITE(cmdbase[5]))
{
// Use a terminal window to run the command in.
x = mch_call_shell_terminal(cmd, options);
# ifdef FEAT_TITLE # ifdef FEAT_TITLE
resettitle(); resettitle();
# endif # endif
return x; return x;
}
} }
#endif #endif

View File

@@ -767,6 +767,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1492,
/**/ /**/
1491, 1491,
/**/ /**/