diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/prompt.c | 2 | ||||
-rw-r--r-- | Test/D01prompt.ztst | 28 |
3 files changed, 34 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index e97ac7eb3..399bc76c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-09-09 Stephane Chazelas <stephane@chazelas.org> + + * 47352 (+ extra test cases): Src/prompt.c, Test/D01prompt.ztst: + fix %<n>K prompt expansion (regression introduced in 5.0.3). + 2020-09-05 Doug Kearns <dougkearns@gmail.com> * unposted: Completion/Unix/Command/_lp, diff --git a/Src/prompt.c b/Src/prompt.c index bc9734720..997327e18 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -258,7 +258,7 @@ parsecolorchar(zattr arg, int is_fg) bv->fm--; } } else - arg = match_colour(NULL, 1, arg); + arg = match_colour(NULL, is_fg, arg); return arg; } diff --git a/Test/D01prompt.ztst b/Test/D01prompt.ztst index 7ff478e68..3fb27e620 100644 --- a/Test/D01prompt.ztst +++ b/Test/D01prompt.ztst @@ -229,3 +229,31 @@ Ffoo=${(%):-'%F{foo}'} # Unrecognised [[ $f == $Fdefault && $Fdefault == $Freset && $Freset == $Ffoo ]] 0:Regression test for workers/44029 + + if + zmodload zsh/terminfo >& /dev/null && + (( terminfo[colors] >= 8 )) + then + F1=$(echoti setaf 2) + F2=${(%):-%2F} + F3=${(%):-%F{2}} + F4=${(%):-%F{green}} + [[ -n $F1 && $F1 = $F2 && $F2 = $F3 && $F3 = $F4 ]] + else + ZTST_skip='Missing terminfo module or non-colour terminal' + fi +0:Equivalence of terminal colour settings (foreground colour) + + if + zmodload zsh/terminfo >& /dev/null && + (( terminfo[colors] >= 8 )) + then + K1=$(echoti setab 2) + K2=${(%):-%2K} + K3=${(%):-%K{2}} + K4=${(%):-%K{green}} + [[ -n $K1 && $K1 = $K2 && $K2 = $K3 && $K3 = $K4 ]] + else + ZTST_skip='Missing terminfo module or non-colour terminal' + fi +0:Equivalence of terminal colour settings (background colour) |