changeset 13160:cb99d9198c39 v8.0.1454

patch 8.0.1454: when in silent mode too much output is buffered commit https://github.com/vim/vim/commit/42b23fad1d9cdd6266f52d1ed7e0f3f17ce2d04b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 3 14:46:45 2018 +0100 patch 8.0.1454: when in silent mode too much output is buffered Problem: When in silent mode too much output is buffered. Solution: Use line buffering instead of fully buffered. (Brian M. Carlson, closes #2537)
author Christian Brabandt <cb@256bit.org>
date Sat, 03 Feb 2018 15:00:06 +0100
parents 12526d13b903
children 12a782ea6e51
files src/main.c src/version.c
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.c
+++ b/src/main.c
@@ -359,6 +359,13 @@ main
      */
     check_tty(&params);
 
+#ifdef _IOLBF
+    /* Ensure output works usefully without a tty: buffer lines instead of
+     * fully buffered. */
+    if (silent_mode)
+	setvbuf(stdout, NULL, _IOLBF, 0);
+#endif
+
     /* This message comes before term inits, but after setting "silent_mode"
      * when the input is not a tty. */
     if (GARGCOUNT > 1 && !silent_mode)
@@ -2532,7 +2539,7 @@ scripterror:
 
 /*
  * Print a warning if stdout is not a terminal.
- * When starting in Ex mode and commands come from a file, set Silent mode.
+ * When starting in Ex mode and commands come from a file, set silent_mode.
  */
     static void
 check_tty(mparm_T *parmp)
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1454,
+/**/
     1453,
 /**/
     1452,