about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/params.yo9
-rw-r--r--Src/input.c5
-rw-r--r--Src/params.c7
4 files changed, 23 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b0d053427..393281cf8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-31  Oliver Kiddle  <opk@zsh.org>
+
+	* Derek Peschel: 16492: Src/params.c, Src/input.c, Doc/Zsh/params.yo:
+	add RPROMPT2 variable for right prompts in multi-line commands
+
 2002-01-31  Andrew Main (Zefram)  <zefram@zsh.org>
 
 	* 16527: Src/Zle/zle_refresh.c: Don't lose the rprompt when
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index 9c17117a3..fb83863a1 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -966,6 +966,15 @@ when the primary prompt is being displayed on the left.
 This does not work if the tt(SINGLELINEZLE) option is set.
 It is expanded in the same way as tt(PS1).
 )
+vindex(RPROMPT2)
+xitem(tt(RPROMPT2) <S>)
+vindex(RPS2)
+item(tt(RPS2) <S>)(
+This prompt is displayed on the right-hand side of the screen
+when the secondary prompt is being displayed on the left.
+This does not work if the tt(SINGLELINEZLE) option is set.
+It is expanded in the same way as tt(PS2).
+)
 vindex(SAVEHIST)
 item(tt(SAVEHIST))(
 The maximum number of history events to save in the history file.
diff --git a/Src/input.c b/Src/input.c
index ba01dd068..a95dac52c 100644
--- a/Src/input.c
+++ b/Src/input.c
@@ -226,8 +226,11 @@ inputline(void)
 
     /* If reading code interactively, work out the prompts. */
     if (interact && isset(SHINSTDIN)) {
-	if (!isfirstln)
+	if (!isfirstln) {
 	    ingetcpmptl = prompt2;
+	    if (rprompt2)
+		ingetcpmptr = rprompt2;
+	}
 	else {
 	    ingetcpmptl = prompt;
 	    if (rprompt)
diff --git a/Src/params.c b/Src/params.c
index 8db358b07..ba4776423 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -65,6 +65,7 @@ char *argzero,		/* $0           */
      *prompt4,		/* $PROMPT4     */
      *readnullcmd,	/* $READNULLCMD */
      *rprompt,		/* $RPROMPT     */
+     *rprompt2,		/* $RPROMPT2    */
      *sprompt,		/* $SPROMPT     */
      *wordchars,	/* $WORDCHARS   */
      *zsh_name;		/* $ZSH_NAME    */
@@ -193,12 +194,14 @@ IPDEF7("OPTARG", &zoptarg),
 IPDEF7("NULLCMD", &nullcmd),
 IPDEF7("POSTEDIT", &postedit),
 IPDEF7("READNULLCMD", &readnullcmd),
-IPDEF7("RPROMPT", &rprompt),
 IPDEF7("PS1", &prompt),
+IPDEF7("RPS1", &rprompt),
+IPDEF7("RPROMPT", &rprompt),
 IPDEF7("PS2", &prompt2),
+IPDEF7("RPS2", &rprompt2),
+IPDEF7("RPROMPT2", &rprompt2),
 IPDEF7("PS3", &prompt3),
 IPDEF7("PS4", &prompt4),
-IPDEF7("RPS1", &rprompt),
 IPDEF7("SPROMPT", &sprompt),
 IPDEF7("0", &argzero),