(Accidentally sent this from the wrong address last night -- if one of
the moderators sees that, don't bother approving it.)

The tech ref manual [1] says that it should, but it's not.

My version of groff is outputting the escape sequence in the subject to
turn off bold when I bring up some manpages, but Eterm doesn't dim the
foreground color when it sees that escape sequence.  This happens both
in 0.9.3 and current CVS.  I've also reproduced it with a:

echo -e '\033[1mblah \033[22mblah \033[0mblah'

which should print out one bold blah, and two non-bold ones.  Instead,
it prints out two bold blahs, and one non-bold one.

After some digging through the source, I ended up with the attached
patch (generated against CVS, applies to 0.9.3), which at least fixes
that problem for me (both with manpages and my echo -e test).

Basically, in screen.c, inside scr_color (called from scr_rendition,
called from the handler for that SGR sequence), it duplicates the
VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND -- and blink/background -- tests,
when the bold or blink bits get turned off.  If the appropriate bit is
set in vt_options, it subtracts (minBright - minColor) from the color.
This undoes the change made when that value was added to the color, when
bold or blink was turned on.

I can't believe I'm the only one seeing this, so am I missing something
obvious here?  Or does this really need to be fixed like this?

Thanks!

----

[1] http://www.eterm.org/docs/view.php?doc=ref#escape -- the SGR codes

diff -Naur Eterm-0.9.3/src/screen.c Eterm-0.9.3-patched/src/screen.c
--- Eterm-0.9.3/src/screen.c    2004-01-19 21:04:04.000000000 -0500
+++ Eterm-0.9.3-patched/src/screen.c    2005-04-22 23:10:23.000000000 -0400
@@ -505,6 +505,20 @@
                         break;
                 }
             }
+            else if (!(rstyle & Intensity) && color >= minBright && color <= 
maxBright) {
+                switch (Intensity) {
+                    case RS_Bold:
+                        if (BITFIELD_IS_SET(vt_options, 
VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND)) {
+                            color -= (minBright - minColor);
+                        }
+                        break;
+                    case RS_Blink:
+                        if (BITFIELD_IS_SET(vt_options, 
VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND)) {
+                            color -= (minBright - minColor);
+                        }
+                        break;
+                }
+            }
         }
     }
     switch (Intensity) {

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to