summaryrefslogtreecommitdiff
path: root/Src/Zle
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_main.c19
-rw-r--r--Src/Zle/zle_refresh.c3
2 files changed, 12 insertions, 10 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 804661ac6..7fb6878da 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1115,7 +1115,8 @@ zleread(char **lp, char **rp, int flags, int context)
char *pptbuf;
int pptlen;
- pptbuf = unmetafy(promptexpand(lp ? *lp : NULL, 0, NULL, NULL),
+ pptbuf = unmetafy(promptexpand(lp ? *lp : NULL, 0, NULL, NULL,
+ &pmpt_attr),
&pptlen);
write(2, (WRITE_ARG_2_T)pptbuf, pptlen);
free(pptbuf);
@@ -1145,11 +1146,10 @@ zleread(char **lp, char **rp, int flags, int context)
fetchttyinfo = 0;
trashedzle = 0;
raw_lp = lp;
- lpromptbuf = promptexpand(lp ? *lp : NULL, 1, NULL, NULL);
- pmpt_attr = txtchange;
+ lpromptbuf = promptexpand(lp ? *lp : NULL, 1, NULL, NULL, &pmpt_attr);
raw_rp = rp;
- rpromptbuf = promptexpand(rp ? *rp : NULL, 1, NULL, NULL);
- rpmpt_attr = txtchange;
+ rpmpt_attr = pmpt_attr;
+ rpromptbuf = promptexpand(rp ? *rp : NULL, 1, NULL, NULL, &rpmpt_attr);
free_prepostdisplay();
zlereadflags = flags;
@@ -1725,11 +1725,12 @@ reexpandprompt(void)
if (!reexpanding++) {
free(lpromptbuf);
- lpromptbuf = promptexpand(raw_lp ? *raw_lp : NULL, 1, NULL, NULL);
- pmpt_attr = txtchange;
+ lpromptbuf = promptexpand(raw_lp ? *raw_lp : NULL, 1, NULL, NULL,
+ &pmpt_attr);
+ rpmpt_attr = pmpt_attr;
free(rpromptbuf);
- rpromptbuf = promptexpand(raw_rp ? *raw_rp : NULL, 1, NULL, NULL);
- rpmpt_attr = txtchange;
+ rpromptbuf = promptexpand(raw_rp ? *raw_rp : NULL, 1, NULL, NULL,
+ &rpmpt_attr);
}
reexpanding--;
}
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index dd8c26079..f43ad45e2 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -990,12 +990,13 @@ zrefresh(void)
int tmppos; /* t - tmpline */
int tmpalloced; /* flag to free tmpline when finished */
int remetafy; /* flag that zle line is metafied */
+ int txtchange; /* attributes set after prompts */
struct rparams rpms;
#ifdef MULTIBYTE_SUPPORT
int width; /* width of wide character */
#endif
-
+
/* If this is called from listmatches() (indirectly via trashzle()), and *
* that was called from the end of zrefresh(), then we don't need to do *
* anything. All this `inlist' code is actually unnecessary, but it *