Patch 8.1.1492

14 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 8, 2019, 6:05:45 AM6/8/19
to vim...@googlegroups.com

Patch 8.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)
Files: src/misc2.c, src/os_win32.c


*** ../vim-8.1.1491/src/misc2.c 2019-06-01 17:13:15.884517713 +0200
--- src/misc2.c 2019-06-08 12:04:36.632279179 +0200
***************
*** 3251,3257 ****
/* The external command may update a tags file, clear cached tags. */
tag_freematch();

! if (cmd == NULL || *p_sxq == NUL)
retval = mch_call_shell(cmd, opt);
else
{
--- 3251,3261 ----
/* The external command may update a tags file, clear cached tags. */
tag_freematch();

! 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
{
*** ../vim-8.1.1491/src/os_win32.c 2019-05-28 23:08:12.072648675 +0200
--- src/os_win32.c 2019-06-08 12:03:45.620413374 +0200
***************
*** 4640,4659 ****
}
#endif
#if defined(FEAT_GUI) && defined(FEAT_TERMINAL)
! /* TODO: make the terminal window work with input or output redirected. */
if (
# ifdef VIMDLL
! gui.in_use &&
# endif
! 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);
# ifdef FEAT_TITLE
! resettitle();
# endif
! return x;
}
#endif

--- 4640,4669 ----
}
#endif
#if defined(FEAT_GUI) && defined(FEAT_TERMINAL)
! // TODO: make the terminal window work with input or output redirected.
if (
# ifdef VIMDLL
! gui.in_use &&
# endif
! vim_strchr(p_go, GO_TERMINAL) != NULL
&& (options & (SHELL_FILTER|SHELL_DOOUT|SHELL_WRITE|SHELL_READ)) == 0)
{
! 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();
# endif
! return x;
! }
}
#endif

*** ../vim-8.1.1491/src/version.c 2019-06-07 23:15:16.651436336 +0200
--- src/version.c 2019-06-08 12:00:07.149036974 +0200
***************
*** 769,770 ****
--- 769,772 ----
{ /* Add new patch number below this line */
+ /**/
+ 1492,
/**/

--
Support your right to bare arms! Wear short sleeves!

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

Ken Takata

unread,
Jun 8, 2019, 9:56:19 AM6/8/19
to vim_dev
Hi,

2019/6/8 Sat 19:05:45 UTC+9 Bram Moolenaar wrote:
> Patch 8.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)
> Files: src/misc2.c, src/os_win32.c

> --- 3251,3261 ----


> /* The external command may update a tags file, clear cached tags. */
> tag_freematch();
>
> ! 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
> {

I think we need a check for gui.in_use for VIMDLL here:

--- a/src/misc2.c
+++ b/src/misc2.c
@@ -3253,7 +3253,11 @@ call_shell(char_u *cmd, int opt)



if (cmd == NULL || *p_sxq == NUL

#if defined(FEAT_GUI_MSWIN) && defined(FEAT_TERMINAL)
- || vim_strchr(p_go, GO_TERMINAL) != NULL
+ || (
+# ifdef VIMDLL
+ gui.in_use &&
+# endif
+ vim_strchr(p_go, GO_TERMINAL) != NULL)
#endif


)
retval = mch_call_shell(cmd, opt);

Regards,
Ken Takata

Bram Moolenaar

unread,
Jun 8, 2019, 2:17:53 PM6/8/19
to vim...@googlegroups.com, Ken Takata
Thanks!

--
"Microsoft is like Coke. It's a secret formula, all the money is from
distribution, and their goal is to get Coke everywhere. Open source is like
selling water. There are water companies like Perrier and Poland Spring, but
you're competing with something that's free." -- Carl Howe
Reply all
Reply to author
Forward
0 new messages