summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-08 12:05:22 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-08 12:05:22 +0200
commit7c348bb5ad106cfa35dd45560c5ac5d3c8496c96 (patch)
tree3e785e6ea8495522d39fa893a819f341029721e8
parent606407384144df73a6154aca1d77e071fe1b7651 (diff)
downloadvim-git-7c348bb5ad106cfa35dd45560c5ac5d3c8496c96.tar.gz
patch 8.1.1492: MS-Windows: when "!" is in 'guioptions' ":!start" failsv8.1.1492
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)
-rw-r--r--src/misc2.c6
-rw-r--r--src/os_win32.c24
-rw-r--r--src/version.c2
3 files changed, 24 insertions, 8 deletions
diff --git a/src/misc2.c b/src/misc2.c
index 2ac7f5e77..45070d719 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -3251,7 +3251,11 @@ call_shell(char_u *cmd, int opt)
/* The external command may update a tags file, clear cached tags. */
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);
else
{
diff --git a/src/os_win32.c b/src/os_win32.c
index 60bf34131..1b961b22c 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4640,20 +4640,30 @@ mch_call_shell(
}
#endif
#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 (
# ifdef VIMDLL
- gui.in_use &&
+ gui.in_use &&
# 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)
{
- /* Use a terminal window to run the command in. */
- x = mch_call_shell_terminal(cmd, options);
+ char_u *cmdbase = cmd;
+
+ // 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
- resettitle();
+ resettitle();
# endif
- return x;
+ return x;
+ }
}
#endif
diff --git a/src/version.c b/src/version.c
index 79d040037..d1ef98b55 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1492,
+/**/
1491,
/**/
1490,