Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Add literal prompt support this allows one to do:



details:   https://anonhg.NetBSD.org/src/rev/260f8bfd727f
branches:  trunk
changeset: 354750:260f8bfd727f
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jun 27 23:27:03 2017 +0000

description:
Add literal prompt support this allows one to do:
CA="$(printf '\1')"
PS1="${CA}$(tput bold)${CA}\$${CA}$(tput sgr0)${CA} "

diffstat:

 bin/sh/histedit.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r bbdc0a99f4f8 -r 260f8bfd727f bin/sh/histedit.c
--- a/bin/sh/histedit.c Tue Jun 27 23:25:13 2017 +0000
+++ b/bin/sh/histedit.c Tue Jun 27 23:27:03 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: histedit.c,v 1.50 2017/06/27 02:22:08 kre Exp $        */
+/*     $NetBSD: histedit.c,v 1.51 2017/06/27 23:27:03 christos Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.50 2017/06/27 02:22:08 kre Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.51 2017/06/27 23:27:03 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -134,7 +134,7 @@
                        if (el != NULL) {
                                if (hist)
                                        el_set(el, EL_HIST, history, hist);
-                               el_set(el, EL_PROMPT, getprompt);
+                               el_set(el, EL_PROMPT_ESC, getprompt, L'\1');
                                el_set(el, EL_SIGNAL, 1);
                                el_set(el, EL_ALIAS_TEXT, alias_text, NULL);
                                el_set(el, EL_ADDFN, "rl-complete",



Home | Main Index | Thread Index | Old Index