bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

screen bug report: default fg/bg color with unusual terminals


From: Todd Larason
Subject: screen bug report: default fg/bg color with unusual terminals
Date: Mon, 29 Oct 2001 23:58:24 -0800

I'm using an 'xterm' that supports up to 256 colors.  This is a compile-time
option with the XFree86 xterms since about XFree 4.0, although I don't know of
any distributions shipping with it standard.

Recent ECMA standards define an extended SGR syntax for this, based on the
'38' and '48' codes.  The next attribute is a key giving the namespace the
color is selected from, and any following attributes select the color itself.
the '5' namespace is a direct-indexed table, and is the only namespace
supported by this xterm.  All the old SGR codes are still supported, including
39 and 49.

Accordingingly, setb and setab are '\E[48;5;%p1%dm'; setf and setaf are
'\E38;5;%p1%dm'.  op is still defined as '\E[39;49m'.

With screen 3.9.8 and other recent versions, this creates a problem.
termcap.c, around line 215:

      if (D_OP && InStr(D_OP, "\033[39;49m"))
        D_CAX = 1;

display.c, ~1809:

  if (!D_CAX && (D_CAF || D_CAB) && ((f == 0 && f != of) || (b == 0 && b !=
ob)))
    {
      int oattr;

      oattr = D_rend.attr;
      AddStr("\033[m");
      D_rend.attr = 0;
      D_rend.color = 0;
      of = ob = 0;
      SetAttr(oattr);
    }
  if (D_CAF || D_CAB)
    {
      if (f != of)
      CPutStr(D_CAF, 9 - f);
      if (b != ob)
      CPutStr(D_CAB, 9 - b);
    }

for both foreground and background, the default color as stored in f & b is
'0'.  So, on this terminal, screen attempts to go to default colors by setting
the color to '9'.  

But color 9 is an actual color, a deep red.
-- 
I don't think we need more bugs.  -- Rick O'Brien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]