Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/ex_cmds.c b/src/ex_cmds.c
- index caf0b1501..e4356056e 100644
- --- a/src/ex_cmds.c
- +++ b/src/ex_cmds.c
- @@ -1540,8 +1540,9 @@ do_shell(
- #ifndef FEAT_GUI_MSWIN
- int save_nwr;
- #endif
- -#ifdef MSWIN
- - int winstart = FALSE;
- +#if defined(MSWIN) || defined(FEAT_GUI_MSWIN) \
- + || (defined(FEAT_GUI) && defined(FEAT_TERMINAL))
- + int keep_termcap = FALSE;
- #endif
- /*
- @@ -1560,11 +1561,12 @@ do_shell(
- * Check if ":!start" is used.
- */
- if (cmd != NULL)
- - winstart = (STRNICMP(cmd, "start ", 6) == 0);
- -# ifdef FEAT_GUI_MSWIN
- - else
- - winstart = 1;
- -# endif
- + keep_termcap = (STRNICMP(cmd, "start ", 6) == 0);
- +#endif
- +
- +#if defined(FEAT_GUI) && defined(FEAT_TERMINAL)
- + if (vim_strchr(p_go, GO_TERMINAL) != NULL)
- + keep_termcap = TRUE;
- #endif
- /*
- @@ -1575,12 +1577,12 @@ do_shell(
- if (!autocmd_busy)
- {
- #ifdef MSWIN
- - if (!winstart)
- + if (!keep_termcap)
- #endif
- stoptermcap();
- }
- #ifdef MSWIN
- - if (!winstart)
- + if (!keep_termcap)
- #endif
- msg_putchar('\n'); /* may shift screen one line up */
- @@ -1590,12 +1592,12 @@ do_shell(
- if (bufIsChangedNotTerm(buf))
- {
- #ifdef FEAT_GUI_MSWIN
- - if (!winstart)
- + if (!keep_termcap)
- starttermcap(); /* don't want a message box here */
- #endif
- msg_puts(_("[No write since last change]\n"));
- #ifdef FEAT_GUI_MSWIN
- - if (!winstart)
- + if (!keep_termcap)
- stoptermcap();
- #endif
- break;
- @@ -1636,7 +1638,7 @@ do_shell(
- #ifndef FEAT_GUI_MSWIN
- if (cmd == NULL
- # ifdef MSWIN
- - || (winstart && !need_wait_return)
- + || (keep_termcap && !need_wait_return)
- # endif
- )
- {
- @@ -1663,7 +1665,7 @@ do_shell(
- #endif /* FEAT_GUI_MSWIN */
- #ifdef MSWIN
- - if (!winstart) /* if winstart==TRUE, never stopped termcap! */
- + if (!keep_termcap) /* if keep_termcap==TRUE, never stopped termcap! */
- #endif
- starttermcap(); /* start termcap if not done by wait_return() */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement