about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-05-12 13:50:42 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-05-12 13:50:42 +0000
commitbd70d684fcf40ff1fba07ec69bd08e1ce40cbd2f (patch)
tree3392bb954086841c7351e06b45e82594342f4e31 /Src/Zle
parent58580d31f593021e2ed4bfad8362e3b01bf396f3 (diff)
downloadzsh-bd70d684fcf40ff1fba07ec69bd08e1ce40cbd2f.tar.gz
zsh-bd70d684fcf40ff1fba07ec69bd08e1ce40cbd2f.tar.xz
zsh-bd70d684fcf40ff1fba07ec69bd08e1ce40cbd2f.zip
25002: only ZLE should update attributes resulting from prompt expansion
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     *