From a4106e0523036bff9eb1556629bd44a359444d93 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 17 May 2009 18:23:09 +0000 Subject: Greg Klanderman: 26964 (modified): PROMPT_EOL_MARK --- Src/utils.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Src/utils.c') 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); } -- cgit 1.4.1