Re: Patch 8.0.0097

2016-11-24 Fir de Conversatie Ken Takata
Hi Bram,

2016/11/25 Fri 1:23:12 UTC+9 Bram Moolenaar wrote:
> Patch 8.0.0097
> Problem:When a channel callback consumes a lot of time Vim becomes
> unresponsive. (skywind)
> Solution:   Bail out of checking channel readahead after 100 msec.
> Files:  src/os_unix.c, src/misc2.c, src/vim.h, src/os_win32.c

> + long
> + elapsed(DWORD start_tick)
> + {
> + DWORD   now = GetTickCount();
> + 
> + if (now < start_tick)
> + /* overflow */
> + return (long)now;
> + return (long)now - (long)start_tick;
> + }

I don't think overflow checking is needed here.

return (long)now - (long)start_tick;

should work on Windows even if overflow occurs.

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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.0.0101

2016-11-24 Fir de Conversatie Bram Moolenaar

Patch 8.0.0101
Problem:Some options are not strictly checked.
Solution:   Add flags for strickter checks.
Files:  src/option.c


*** ../vim-8.0.0100/src/option.c2016-11-24 18:30:55.715444785 +0100
--- src/option.c2016-11-24 21:38:32.823206218 +0100
***
*** 992,998 
(char_u *)NULL, PV_NONE,
  #endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
! {"dictionary",  "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
  #ifdef FEAT_INS_EXPAND
(char_u *)_dict, PV_DICT,
  #else
--- 992,998 
(char_u *)NULL, PV_NONE,
  #endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
! {"dictionary",  "dict", 
P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NFNAME,
  #ifdef FEAT_INS_EXPAND
(char_u *)_dict, PV_DICT,
  #else
***
*** 2058,2064 
{(char_u *)NULL, (char_u *)0L}
  #endif
SCRIPTID_INIT},
! {"printexpr", "pexpr",  P_STRING|P_VI_DEF,
  #ifdef FEAT_POSTSCRIPT
(char_u *)_pexpr, PV_NONE,
{(char_u *)"", (char_u *)0L}
--- 2058,2064 
{(char_u *)NULL, (char_u *)0L}
  #endif
SCRIPTID_INIT},
! {"printexpr", "pexpr",  P_STRING|P_VI_DEF|P_SECURE,
  #ifdef FEAT_POSTSCRIPT
(char_u *)_pexpr, PV_NONE,
{(char_u *)"", (char_u *)0L}
***
*** 7021,7026 
--- 7021,7027 
  
  
  #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+ /* 'toolbar' */
  else if (varp == _toolbar)
  {
if (opt_strings_flags(p_toolbar, p_toolbar_values,
***
*** 7235,7240 
--- 7236,7242 
  #endif
  
  #if defined(FEAT_RENDER_OPTIONS)
+ /* 'renderoptions' */
  else if (varp == _rop && gui.in_use)
  {
if (!gui_mch_set_rendering_options(p_rop))
***
*** 7262,7280 
  else
  {
p = NULL;
!   if (varp == _ww)
p = (char_u *)WW_ALL;
!   if (varp == _shm)
p = (char_u *)SHM_ALL;
!   else if (varp == &(p_cpo))
p = (char_u *)CPO_ALL;
!   else if (varp == &(curbuf->b_p_fo))
p = (char_u *)FO_ALL;
  #ifdef FEAT_CONCEAL
!   else if (varp == >w_p_cocu)
p = (char_u *)COCU_ALL;
  #endif
!   else if (varp == _mouse)
{
  #ifdef FEAT_MOUSE
p = (char_u *)MOUSE_ALL;
--- 7264,7282 
  else
  {
p = NULL;
!   if (varp == _ww) /* 'whichwrap' */
p = (char_u *)WW_ALL;
!   if (varp == _shm) /* 'shortmess' */
p = (char_u *)SHM_ALL;
!   else if (varp == &(p_cpo)) /* 'cpoptions' */
p = (char_u *)CPO_ALL;
!   else if (varp == &(curbuf->b_p_fo)) /* 'formatoptions' */
p = (char_u *)FO_ALL;
  #ifdef FEAT_CONCEAL
!   else if (varp == >w_p_cocu) /* 'concealcursor' */
p = (char_u *)COCU_ALL;
  #endif
!   else if (varp == _mouse) /* 'mouse' */
{
  #ifdef FEAT_MOUSE
p = (char_u *)MOUSE_ALL;
***
*** 7284,7290 
  #endif
}
  #if defined(FEAT_GUI)
!   else if (varp == _go)
p = (char_u *)GO_ALL;
  #endif
if (p != NULL)
--- 7286,7292 
  #endif
}
  #if defined(FEAT_GUI)
!   else if (varp == _go) /* 'guioptions' */
p = (char_u *)GO_ALL;
  #endif
if (p != NULL)
*** ../vim-8.0.0100/src/version.c   2016-11-24 18:30:55.715444785 +0100
--- src/version.c   2016-11-24 19:54:59.141485534 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 101,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
42. Your virtual girlfriend finds a new net sweetheart with a larger bandwidth.

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

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.0.0100

2016-11-24 Fir de Conversatie Bram Moolenaar

Patch 8.0.0100
Problem:Options that are a file name may contain non-filename characters.
Solution:   Check for more invalid characters.
Files:  src/option.c


*** ../vim-8.0.0099/src/option.c2016-11-10 20:01:41.197582893 +0100
--- src/option.c2016-11-24 17:58:37.652276224 +0100
***
*** 5880,5886 
   * separator (slash and/or backslash), wildcards and characters that are
   * often illegal in a file name. */
  else if ((options[opt_idx].flags & P_NFNAME)
!&& vim_strpbrk(*varp, (char_u *)"/\\*?[|<>") != NULL)
  {
errmsg = e_invarg;
  }
--- 5880,5886 
   * separator (slash and/or backslash), wildcards and characters that are
   * often illegal in a file name. */
  else if ((options[opt_idx].flags & P_NFNAME)
!   && vim_strpbrk(*varp, (char_u *)"/\\*?[|;&<>\r\n") != NULL)
  {
errmsg = e_invarg;
  }
*** ../vim-8.0.0099/src/version.c   2016-11-24 17:47:03.865021031 +0100
--- src/version.c   2016-11-24 17:59:26.683951638 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 100,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
40. You tell the cab driver you live at
http://123.elm.street/house/bluetrim.html
41. You actually try that 123.elm.street address.

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

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] Incorrect cursor position on a long wrapped-line

2016-11-24 Fir de Conversatie Ozaki Kiichi
Thank you for your confirmation.

> Could you write a test for that? Thanks.

All right, I will do it.

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.0.0099

2016-11-24 Fir de Conversatie Bram Moolenaar

Patch 8.0.0099
Problem:Popup menu always appears above the cursor when it is in the lower
half of the screen. (Matt Gardner)
Solution:   Compute the available space better. (Hirohito Higashi,
closes #1241)
Files:  src/popupmnu.c


*** ../vim-8.0.0098/src/popupmnu.c  2016-11-04 22:08:26.014082864 +0100
--- src/popupmnu.c  2016-11-24 17:37:44.964839700 +0100
***
*** 105,111 
  
  /* Put the pum below "row" if possible.  If there are few lines decide on
   * where there is more room. */
! if (row - above_row >= below_row - row)
  {
/* pum above "row" */
  
--- 105,112 
  
  /* Put the pum below "row" if possible.  If there are few lines decide on
   * where there is more room. */
! if (row + 2 >= below_row - pum_height
!   && row - above_row > (below_row - above_row) / 2)
  {
/* pum above "row" */
  
*** ../vim-8.0.0098/src/version.c   2016-11-24 17:33:12.430669286 +0100
--- src/version.c   2016-11-24 17:38:35.820495843 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 99,
  /**/

-- 
Microsoft is to software what McDonalds is to gourmet cooking

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

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.0.0098

2016-11-24 Fir de Conversatie Bram Moolenaar

Patch 8.0.0098 (after 8.0.0097)
Problem:Can't build on MS-Windows.
Solution:   Add missing parenthesis.
Files:  src/vim.h


*** ../vim-8.0.0097/src/vim.h   2016-11-24 17:22:46.150837087 +0100
--- src/vim.h   2016-11-24 17:31:56.371175210 +0100
***
*** 2512,2518 
  #else
  # if defined(WIN32)
  #  define ELAPSED_TICKCOUNT
! #  define ELAPSED_INIT(v) v = GetTickCount
  #  define ELAPSED_FUNC(v) elapsed(v)
  #  define ELAPSED_TYPE DWORD
  long elapsed(DWORD start_tick);
--- 2512,2518 
  #else
  # if defined(WIN32)
  #  define ELAPSED_TICKCOUNT
! #  define ELAPSED_INIT(v) v = GetTickCount()
  #  define ELAPSED_FUNC(v) elapsed(v)
  #  define ELAPSED_TYPE DWORD
  long elapsed(DWORD start_tick);
*** ../vim-8.0.0097/src/version.c   2016-11-24 17:22:46.154837060 +0100
--- src/version.c   2016-11-24 17:32:38.990891710 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 98,
  /**/

-- 
"Oh, no!  NOT the Spanish Inquisition!"
"NOBODY expects the Spanish Inquisition!!!"
-- Monty Python sketch --
"Oh, no!  NOT another option!"
"EVERYBODY expects another option!!!"
-- Discussion in vim-dev mailing list --

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

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: "ch_read()" couldn't tell the difference between "not enough message" and "a empty line"

2016-11-24 Fir de Conversatie Bram Moolenaar

Skywind wrote:

> The callback of "out_cb" is convenience to use, but has performance issue:
> Gui gets freezed if the background job continues outputing massive data (eg, 
> grep a high frequency word "to" on the documents root, or some crazy stl 
> errors).
> 
> Vim is busy in receiving the data and invoking "out_cb" which cause gui no 
> responsed for a very noticeable period.
> 
> The practice way to prevent gui freeze is introducing a flow control for 
> background process by reading the fixed number of lines from the channel on a 
> timer (eg, read 50 lines from stdout each 100ms interval).
> 
> If the grep output is faster then the reader in the timer, system pipe will 
> be full and "invoking write()" will block the child process until the system 
> pipe buffer has free space again (some data have been readed out by vim).
> 
> In order to process the job output more smoothly, I tried to use this 
> approach but when I am ready to read data from the channel in a timer, It is 
> confused that both "\n" (empty line) and "not enough data" return "" from 
> ch_read().
> 
> If I want to read out at most 100 lines from a channel in an interval, how 
> can I tell if there is no data at the moment or it's just a "\n" from child 
> process ?
> 
> No clue to decide whether to continue reading or just break out.
> 
> When I am using "(pipe object).readline()" from python's subprocess module, 
> "abc\n" means a line "abc", "\n" means an empty line and "" means not enough 
> data. It's very simple without any ambiguity.
> 
> But when I am using "ch_read()" in vim. "abc" means a line "abc", and both 
> (empty line) and (no message) return "".
> 
> Is it a "logic fallacy" of "ch_read()" ??

Can you please try out 8.0.0097 using out_cb and check that it works
better?

-- 
The future isn't what it used to be.

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

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.0.0097

2016-11-24 Fir de Conversatie Bram Moolenaar

Patch 8.0.0097
Problem:When a channel callback consumes a lot of time Vim becomes
unresponsive. (skywind)
Solution:   Bail out of checking channel readahead after 100 msec.
Files:  src/os_unix.c, src/misc2.c, src/vim.h, src/os_win32.c


*** ../vim-8.0.0096/src/os_unix.c   2016-11-17 17:25:28.212093109 +0100
--- src/os_unix.c   2016-11-24 17:10:57.847711807 +0100
***
*** 376,396 
RealWaitForChar(read_cmd_fd, p_wd, NULL, NULL);
  }
  
- #if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
- /*
-  * Return time in msec since "start_tv".
-  */
- static long
- elapsed(struct timeval *start_tv)
- {
- struct timeval  now_tv;
- 
- gettimeofday(_tv, NULL);
- return (now_tv.tv_sec - start_tv->tv_sec) * 1000L
-+ (now_tv.tv_usec - start_tv->tv_usec) / 1000L;
- }
- #endif
- 
  /*
   * mch_inchar(): low level input function.
   * Get a characters from the keyboard.
--- 376,381 
***
*** 411,420 
  int   did_start_blocking = FALSE;
  long  wait_time;
  long  elapsed_time = 0;
! #if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
! struct timeval  start_tv;
  
! gettimeofday(_tv, NULL);
  #endif
  
  /* repeat until we got a character or waited long enough */
--- 396,405 
  int   did_start_blocking = FALSE;
  long  wait_time;
  long  elapsed_time = 0;
! #ifdef ELAPSED_FUNC
! ELAPSED_TYPE start_tv;
  
! ELAPSED_INIT(start_tv);
  #endif
  
  /* repeat until we got a character or waited long enough */
***
*** 438,445 
else
/* going to block after p_ut */
wait_time = p_ut;
! #if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
!   elapsed_time = elapsed(_tv);
  #endif
wait_time -= elapsed_time;
if (wait_time < 0)
--- 423,430 
else
/* going to block after p_ut */
wait_time = p_ut;
! #ifdef ELAPSED_FUNC
!   elapsed_time = ELAPSED_FUNC(start_tv);
  #endif
wait_time -= elapsed_time;
if (wait_time < 0)
***
*** 1554,1571 
  
  #ifdef FEAT_X11
  
! # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) \
&& (defined(FEAT_XCLIPBOARD) || defined(FEAT_TITLE))
  
- static void xopen_message(struct timeval *start_tv);
- 
  /*
   * Give a message about the elapsed time for opening the X window.
   */
  static void
! xopen_message(struct timeval *start_tv)
  {
! smsg((char_u *)_("Opening the X display took %ld msec"), 
elapsed(start_tv));
  }
  # endif
  #endif
--- 1539,1554 
  
  #ifdef FEAT_X11
  
! # if defined(ELAPSED_TIMEVAL) \
&& (defined(FEAT_XCLIPBOARD) || defined(FEAT_TITLE))
  
  /*
   * Give a message about the elapsed time for opening the X window.
   */
  static void
! xopen_message(long elapsed_msec)
  {
! smsg((char_u *)_("Opening the X display took %ld msec"), elapsed_msec);
  }
  # endif
  #endif
***
*** 1864,1874 
  #endif
if (x11_display != NULL)
{
! # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
if (p_verbose > 0)
{
verbose_enter();
!   xopen_message(_tv);
verbose_leave();
}
  # endif
--- 1847,1857 
  #endif
if (x11_display != NULL)
{
! # ifdef ELAPSED_FUNC
if (p_verbose > 0)
{
verbose_enter();
!   xopen_message(ELAPSED_FUNC(start_tv));
verbose_leave();
}
  # endif
***
*** 4630,4637 
ga_init2(, 1, BUFLEN);
  
noread_cnt = 0;
! # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
!   gettimeofday(_tv, NULL);
  # endif
for (;;)
{
--- 4613,4620 
ga_init2(, 1, BUFLEN);
  
noread_cnt = 0;
! # ifdef ELAPSED_FUNC
!   ELAPSED_INIT(start_tv);
  # endif
for (;;)
{
***
*** 4666,4673 
  /* Get extra characters when we don't have any.
   * Reset the counter and timer. */
  noread_cnt = 0;
! # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
! gettimeofday(_tv, NULL);
  # endif
  len = ui_inchar(ta_buf, BUFLEN, 10L, 0);
  }
--- 4649,4656 
  /* Get extra characters when we don't have any.
   * Reset the counter and timer. */
  noread_cnt = 0;
! # ifdef ELAPSED_FUNC
! ELAPSED_INIT(start_tv);
  # endif
  len = ui_inchar(ta_buf, BUFLEN, 10L, 0);
  }
***
*** 4886,4895 
   

Re: [vim/vim] E924: Current window was closed (#1267)

2016-11-24 Fir de Conversatie Yegappan Lakshmanan
Hi,

On Tue, Nov 22, 2016 at 3:52 AM, btwe  wrote:
> I am not sure if the following is an issue with vim or my plugin. But the
> issue came up between vim 7.4 and 7.9/8.0.
>
> Reproduce:
>

Can you try to reproduce this problem after starting Vim with
"vim -N -u NONE"?

I tried to reproduce this problem using a simple location list grep
(as I don't have the td_vimwiki.py script) and couldn't reproduce
the problem.

>
> Create a location list with lgrep while having a file opened in a buffer
> window.
>
>   let l:grepprg_bak=
>   let l:grepformat_bak=
>   try
> let ="./td_vimwiki.py -o D
> let ="%f:%l %m"
> silent lgrep!
> redraw!
> lopen 30
>   finally
> let =l:grepprg_bak
> let =l:grepformat_bak
>   endtry
>
> Symptom:
>
> In v7.4 it works as expected. The location list shows up in split window,
> pressing Enter on an entry opens the file containing the target and
> positions the pointer there.
> In 7.9/8.0 Pressing Enter on an entry, first prints an error message: E924:
> Current window was closed. After that the target file is opened in a new
> buffer, but the pointer is placed at line 1 col 1. Creating the location
> list again and selecting the target of the currently opened buffer works
> again as expected.
>
> Because, I do not know if I did something wrong in my plugin, or a small bug
> made it into vim during the releases, I opened this issue and also kindly
> ask for help if the problem is on my side.
>

Are you using any autocmds/plugins that alter the windows when opening
a file?

- Yegappan

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.0.0096

2016-11-24 Fir de Conversatie Bram Moolenaar

Patch 8.0.0096
Problem:When the input or output is not a tty Vim appears to hang.
Solution:   Add the --ttyfail argument.  Also add the "ttyin" and "ttyout"
features to be able to check in Vim script.
Files:  src/globals.h, src/structs.h, src/main.c, src/evalfunc.c,
runtime/doc/starting.txt, runtime/doc/eval.txt


*** ../vim-8.0.0095/src/globals.h   2016-11-10 20:01:41.181582995 +0100
--- src/globals.h   2016-11-24 14:47:12.106114198 +0100
***
*** 643,648 
--- 643,650 
  EXTERN intreally_exiting INIT(= FALSE);
/* TRUE when we are sure to exit, e.g., after
 * a deadly signal */
+ EXTERN intstdout_isatty INIT(= TRUE); /* is stdout a terminal? */
+ 
  #if defined(FEAT_AUTOCHDIR)
  EXTERN inttest_autochdir INIT(= FALSE);
  #endif
*** ../vim-8.0.0095/src/structs.h   2016-11-17 17:25:28.212093109 +0100
--- src/structs.h   2016-11-24 14:47:01.506180720 +0100
***
*** 3225,3232 
  #endif
  
  int   want_full_screen;
- int   stdout_isatty;  /* is stdout a terminal? */
  int   not_a_term; /* no warning for missing term? 
*/
  char_u*term;  /* specified terminal name */
  #ifdef FEAT_CRYPT
  int   ask_for_key;/* -x argument */
--- 3225,3232 
  #endif
  
  int   want_full_screen;
  int   not_a_term; /* no warning for missing term? 
*/
+ int   tty_fail;   /* exit if not a tty */
  char_u*term;  /* specified terminal name */
  #ifdef FEAT_CRYPT
  int   ask_for_key;/* -x argument */
*** ../vim-8.0.0095/src/main.c  2016-08-29 22:42:20.0 +0200
--- src/main.c  2016-11-24 14:46:47.594268023 +0100
***
*** 973,979 
   * (needed for :! to * work). mch_check_win() will also handle the -d or
   * -dev argument.
   */
! paramp->stdout_isatty = (mch_check_win(paramp->argc, paramp->argv) != 
FAIL);
  TIME_MSG("window checked");
  
  /*
--- 973,979 
   * (needed for :! to * work). mch_check_win() will also handle the -d or
   * -dev argument.
   */
! stdout_isatty = (mch_check_win(paramp->argc, paramp->argv) != FAIL);
  TIME_MSG("window checked");
  
  /*
***
*** 1828,1833 
--- 1828,1834 
/* "--literal" take files literally */
/* "--nofork" don't fork */
/* "--not-a-term" don't warn for not a term */
+   /* "--ttyfail" exit if not a term */
/* "--noplugin[s]" skip plugins */
/* "--cmd " execute cmd before vimrc */
if (STRICMP(argv[0] + argv_idx, "help") == 0)
***
*** 1857,1862 
--- 1858,1865 
p_lpl = FALSE;
else if (STRNICMP(argv[0] + argv_idx, "not-a-term", 10) == 0)
parmp->not_a_term = TRUE;
+   else if (STRNICMP(argv[0] + argv_idx, "ttyfail", 7) == 0)
+   parmp->tty_fail = TRUE;
else if (STRNICMP(argv[0] + argv_idx, "cmd", 3) == 0)
{
want_argument = TRUE;
***
*** 2489,2495 
if (!input_isatty)
silent_mode = TRUE;
  }
! else if (parmp->want_full_screen && (!parmp->stdout_isatty || 
!input_isatty)
  #ifdef FEAT_GUI
/* don't want the delay when started from the desktop */
&& !gui.starting
--- 2492,2498 
if (!input_isatty)
silent_mode = TRUE;
  }
! else if (parmp->want_full_screen && (!stdout_isatty || !input_isatty)
  #ifdef FEAT_GUI
/* don't want the delay when started from the desktop */
&& !gui.starting
***
*** 2504,2510 
 * input buffer so fast I can't even kill the process in under 2
 * minutes (and it beeps continuously the whole time :-)
 */
!   if (netbeans_active() && (!parmp->stdout_isatty || !input_isatty))
{
mch_errmsg(_("Vim: Error: Failure to start gvim from NetBeans\n"));
exit(1);
--- 2507,2513 
 * input buffer so fast I can't even kill the process in under 2
 * minutes (and it beeps continuously the whole time :-)
 */
!   if (netbeans_active() && (!stdout_isatty || !input_isatty))
{
mch_errmsg(_("Vim: Error: Failure to start gvim from NetBeans\n"));
exit(1);
***
*** 2517,2527 
exit(1);
}
  #endif
!   if (!parmp->stdout_isatty)
mch_errmsg(_("Vim: Warning: Output is not to a terminal\n"));
if (!input_isatty)
mch_errmsg(_("Vim: Warning: