summary refs log tree commit diff
path: root/bin/1sh/parser.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-03-09 19:15:33 -0400
committerJune McEnroe <june@causal.agency>2020-03-09 20:01:30 -0400
commitd495c77ca7d302a4c4c39ac42eedd9288ce007bb (patch)
tree1e6af6672e4a6bc2d96bc63d2f32d186dce50217 /bin/1sh/parser.c
parentAdd RPS1 and RPS2 right prompts (diff)
downloadsrc-d495c77ca7d302a4c4c39ac42eedd9288ce007bb.tar.gz
src-d495c77ca7d302a4c4c39ac42eedd9288ce007bb.zip
Add PS0 pre-prompt string
Diffstat (limited to '')
-rw-r--r--bin/1sh/parser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/1sh/parser.c b/bin/1sh/parser.c
index b92b9462..080b84e7 100644
--- a/bin/1sh/parser.c
+++ b/bin/1sh/parser.c
@@ -129,6 +129,7 @@ static void consumetoken(int);
 static void synexpect(int) __dead2;
 static void synerror(const char *) __dead2;
 static void setprompt(int);
+static char *expandprompt(const char *);
 static int pgetc_linecont(void);
 
 
@@ -1937,6 +1938,11 @@ setprompt(int which)
 	if (which == 0)
 		return;
 
+	if (which == 1 && *ps0val()) {
+		out2str(expandprompt(ps0val()));
+		flushout(out2);
+	}
+
 #ifndef NO_HISTORY
 	if (!el)
 #endif