Module Name:    src
Committed By:   christos
Date:           Fri Dec  8 16:56:24 UTC 2017

Modified Files:
        src/lib/libedit: readline.c

Log Message:
For applications that don't issue their own prompt (like python)
don't set unbuffered unless they've already printed the prompt.
This avoids printing the prompt before the application has a chance
to process the input line.
>From sjg@


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/lib/libedit/readline.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.144 src/lib/libedit/readline.c:1.145
--- src/lib/libedit/readline.c:1.144	Sun Sep 17 04:10:08 2017
+++ src/lib/libedit/readline.c	Fri Dec  8 11:56:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.144 2017/09/17 08:10:08 kre Exp $	*/
+/*	$NetBSD: readline.c,v 1.145 2017/12/08 16:56:23 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.144 2017/09/17 08:10:08 kre Exp $");
+__RCSID("$NetBSD: readline.c,v 1.145 2017/12/08 16:56:23 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -2079,7 +2079,10 @@ rl_callback_read_char(void)
 		} else
 			wbuf = NULL;
 		(*(void (*)(const char *))rl_linefunc)(wbuf);
-		el_set(e, EL_UNBUFFERED, 1);
+		if (!rl_already_prompted) {
+		    el_set(e, EL_UNBUFFERED, 1);
+		    rl_already_prompted = 1;
+		}
 	}
 }
 

Reply via email to