mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-30 05:40:58 +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:
parent
29bb2438c0
commit
0945e20323
1 changed files with 5 additions and 1 deletions
|
|
@ -758,7 +758,11 @@ preprompt(void)
|
||||||
/* The PROMPT_SP heuristic will move the prompt down to a new line
|
/* 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
|
* if there was any dangling output on the line (assuming the terminal
|
||||||
* has automatic margins, but we try even if hasam isn't set). */
|
* 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, "");
|
fprintf(shout, "%s%*s\r", str, (int)columns - 1 - !hasxn, "");
|
||||||
free(str);
|
free(str);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue