1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-29 05:21:00 +01:00

The PROMPT_SP code now ensures that PROMPT_PERCENT is enabled when

it uses promptexpand() to expand some percent strings. (21739)
This commit is contained in:
Wayne Davison 2005-09-20 16:33:01 +00:00
parent 29bb2438c0
commit 0945e20323

View file

@ -758,7 +758,11 @@ preprompt(void)
/* The PROMPT_SP heuristic will move the prompt down to a new line
* if there was any dangling output on the line (assuming the terminal
* has automatic margins, but we try even if hasam isn't set). */
char *str = promptexpand("%B%S#%s%b", 0, NULL, NULL);
char *str;
int percents = isset(PROMPTPERCENT);
opts[PROMPTPERCENT] = 1;
str = promptexpand("%B%S#%s%b", 0, NULL, NULL);
opts[PROMPTPERCENT] = percents;
fprintf(shout, "%s%*s\r", str, (int)columns - 1 - !hasxn, "");
free(str);
}