Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit For applications that don't issue their own prom...



details:   https://anonhg.NetBSD.org/src/rev/34c604e9503e
branches:  trunk
changeset: 828332:34c604e9503e
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Dec 08 16:56:23 2017 +0000

description:
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@

diffstat:

 lib/libedit/readline.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 8b2c82fe8f50 -r 34c604e9503e lib/libedit/readline.c
--- a/lib/libedit/readline.c    Fri Dec 08 15:54:40 2017 +0000
+++ b/lib/libedit/readline.c    Fri Dec 08 16:56:23 2017 +0000
@@ -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 @@
                } 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;
+               }
        }
 }
 



Home | Main Index | Thread Index | Old Index