about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-05-17 18:23:09 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-05-17 18:23:09 +0000
commita4106e0523036bff9eb1556629bd44a359444d93 (patch)
tree0bb6abc51e4b71b1cf75e69dc3d7b678976e4ae4 /Src
parent9169cd747f81bf1053e4d230ef1efdfd5aedb642 (diff)
downloadzsh-a4106e0523036bff9eb1556629bd44a359444d93.tar.gz
zsh-a4106e0523036bff9eb1556629bd44a359444d93.tar.xz
zsh-a4106e0523036bff9eb1556629bd44a359444d93.zip
Greg Klanderman: 26964 (modified): PROMPT_EOL_MARK
Diffstat (limited to 'Src')
-rw-r--r--Src/utils.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Src/utils.c b/Src/utils.c
index d259827a9..d30dacca8 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1216,12 +1216,16 @@ preprompt(void)
 	 * Unfortunately it interacts badly with ZLE displaying message
 	 * when ^D has been pressed. So just disable PROMPT_SP logic in
 	 * this case */
+	char *eolmark = getsparam("PROMPT_EOL_MARK");
 	char *str;
-	int percents = opts[PROMPTPERCENT];
+	int percents = opts[PROMPTPERCENT], w = 0;
+	if (!eolmark || !*eolmark)
+	    eolmark = "%B%S%#%s%b";
 	opts[PROMPTPERCENT] = 1;
-	str = promptexpand("%B%S%#%s%b", 0, NULL, NULL, NULL);
+	str = promptexpand(eolmark, 1, NULL, NULL, NULL);
+	countprompt(str, &w, 0, -1);
 	opts[PROMPTPERCENT] = percents;
-	fprintf(shout, "%s%*s\r", str, (int)columns - 1 - !hasxn, "");
+	fprintf(shout, "%s%*s\r", str, (int)columns - w - !hasxn, "");
 	free(str);
     }