Subject: Re: port-amd64/34282: console color is broken on amd64 when using pkgsrc/misc/screen on amd64
To: Thomas Dickey <dickey@radix.net>
From: George Georgalis <george@metrumrg.com>
List: netbsd-bugs
Date: 04/25/2007 14:21:49
On Thu, Oct 05, 2006 at 12:20:00PM -0400, Thomas Dickey wrote:
>On Thu, Oct 05, 2006 at 11:30:02AM -0400, George Georgalis wrote:
>> While I see the logic that the client xterm/termcap is very
>> important, I cannot make any sense as to why my amd64 host
>> is having problems while the i386 does not. If anyone could
>> elucidate that, I am very curious.
>
>I think I mentioned that - here's a more verbose attempt at explaining it.
>
>	a) termcap entries are limited to 1023 bytes.
>
>	   Programs that use termcap assume this, and provide a buffer
>	   of 1024 bytes to hold the data.
>
>	b) some entries (such as screen's) are mechanically derived from
>	   terminfo entries which can be much longer (4096 bytes).
>
>	c) NetBSD termcap library checks for termcap entries longer than
>	   1023 bytes.  If it is asked to retrieve one that is longer,
>	   it returns a modified version of the entry: limited to 1023
>	   bytes and using an address-pointer in a special capability
>	   entry which tells the library where to find the rest of the
>	   data.  
>
>	d) i386 has 32-bit addresses, and amd64 has 64-bit addresses.
>	   The special capability entry's address-pointer will use more
>	   bytes.
>	   
>	e) Perhaps there is a logic error, and the pointer value
>	   as read into the application is truncated.  If the pointer
>	   to the additional information is unusable, the application
>	   cannot get the data.  Color information (from a terminfo
>	   entry as noted above) is usually on the end of the resulting
>	   termcap entry.
>
>	f) Generally the tgetstr() termcap function returns "OOPS" for
>	   missing data.


Much appreciated! So if "e)" is the problem... is
it a problem with screen or termcap?  Sounds like
screen but I'm not sure? Do other applications have
this problem? Would setting TERM within screenrc
be of any help. (of course we need color)

I did an amd64 3.1 cdrom install, built colorls and
screen from pkgsrc, got the toor account setup in
its own dir, so the only non-standard rc file or env
is pkgsrc in PATH.

On local console, "colorls -G /" works unless within
screen, which generates OOPS in place of color
codes.

Can this PR be revisited? Is there any more info I
can provide? (I'd like to report what netbsd-4 does,
but I've not been able to get the upgrade to go.)

// George


-- 
George Georgalis, Information Systems Scientist, Metrum Research Group
2 Tunxis Road, Suite 112, Tariffville, CT 06081; direct: 860.670.4346