Module Name: src
Committed By: christos
Date: Tue Jun 27 23:27:03 UTC 2017
Modified Files:
src/bin/sh: histedit.c
Log Message:
Add literal prompt support this allows one to do:
CA="$(printf '\1')"
PS1="${CA}$(tput bold)${CA}\$${CA}$(tput sgr0)${CA} "
To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/bin/sh/histedit.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.50 src/bin/sh/histedit.c:1.51
--- src/bin/sh/histedit.c:1.50 Mon Jun 26 22:22:08 2017
+++ src/bin/sh/histedit.c Tue Jun 27 19:27:03 2017
@@ -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 @@ histedit(void)
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",