summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/cash/parser.c6
-rw-r--r--bin/cash/var.c3
-rw-r--r--bin/cash/var.h2
3 files changed, 11 insertions, 0 deletions
diff --git a/bin/cash/parser.c b/bin/cash/parser.c
index 86c09776..91771e81 100644
--- a/bin/cash/parser.c
+++ b/bin/cash/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
diff --git a/bin/cash/var.c b/bin/cash/var.c
index 18e5de62..d0c01bb7 100644
--- a/bin/cash/var.c
+++ b/bin/cash/var.c
@@ -94,6 +94,7 @@ struct var vifs;
 struct var vmail;
 struct var vmpath;
 struct var vpath;
+struct var vps0;
 struct var vps1;
 struct var vps2;
 struct var vps4;
@@ -119,6 +120,8 @@ static const struct varinit varinit[] = {
 	  NULL },
 	{ &vpath,	0,				"PATH=" _PATH_DEFPATH,
 	  changepath },
+	{ &vps0,	VUNSET,				"PS0=",
+	  NULL },
 	/*
 	 * vps1 depends on uid
 	 */
diff --git a/bin/cash/var.h b/bin/cash/var.h
index 9ebb7765..31f9dcc7 100644
--- a/bin/cash/var.h
+++ b/bin/cash/var.h
@@ -77,6 +77,7 @@ extern struct var vifs;
 extern struct var vmail;
 extern struct var vmpath;
 extern struct var vpath;
+extern struct var vps0;
 extern struct var vps1;
 extern struct var vps2;
 extern struct var vps4;
@@ -103,6 +104,7 @@ extern int initial_localeisutf8;
 #define mailval()	(vmail.text + 5)
 #define mpathval()	(vmpath.text + 9)
 #define pathval()	(vpath.text + 5)
+#define ps0val()	(vps0.text + 4)
 #define ps1val()	(vps1.text + 4)
 #define ps2val()	(vps2.text + 4)
 #define ps4val()	(vps4.text + 4)
02-11Add chroot targetJune McEnroe 2020-02-11Exit focus and paste modes on err exitJune McEnroe 2020-02-11Add startup GPLv3 note and URLJune McEnroe 2020-02-11Make sure -D_GNU_SOURCE ends up in CFLAGS on LinuxJune McEnroe 2020-02-11Add note about setting PKG_CONFIG_PATHJune McEnroe 2020-02-11Rename query ID on nick changeJune McEnroe 2020-02-11Call completeClear when closing a windowJune McEnroe 2020-02-11Don't insert color codes for non-mentionsJune McEnroe 2020-02-11Take first two words in colorMentionsJune McEnroe 2020-02-11Use time_t for save signatureJune McEnroe 2020-02-11Set self.nick to * initiallyJune McEnroe 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe