changeset: 7184:6e8050965f1a
user:      Kevin McCarthy <[email protected]>
date:      Sat Nov 18 19:13:08 2017 -0800
link:      http://dev.mutt.org/hg/mutt/rev/6e8050965f1a

Fix ansi escape sequences with both reset and color parameters. (closes #3689)

The initial 0 "reset/normal" was setting attr = ANSI_OFF, which was
subsequently being or'ed with ANSI_COLOR.

The color resolution was then checking for the ANSI_OFF bit and
turning all coloring off, even though ANSI_COLOR was also set.

Change the color resolution to check for "attr == ANSI_OFF" instead, so
the color isn't reset unless the reset occurs last in the sequence.

diffs (12 lines):

diff -r 2ff00d88bcf6 -r 6e8050965f1a pager.c
--- a/pager.c   Wed Nov 15 14:53:24 2017 -0800
+++ b/pager.c   Sat Nov 18 19:13:08 2017 -0800
@@ -296,7 +296,7 @@
     {
       color ^= A_BLINK;
     }
-    else if (a->attr & ANSI_OFF)
+    else if (a->attr == ANSI_OFF)
     {
       a->attr = 0;
     }

Reply via email to