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/8b44e717dc2a
branches: trunk
changeset: 358031:8b44e717dc2a
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 242664fff99c -r 8b44e717dc2a 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