Current-Users archive

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

Re: xterm-color256: Different behavior between NetBSD 9.2 and 9.99.93?



I've recently been trying to debug this same problem, and I had been
gathering info until I got side-tracked onto X11 hi-res monitor issues.

At Thu, 3 Feb 2022 16:28:00 +0300, Valery Ushakov <uwe%stderr.spb.ru@localhost> wrote:
Subject: Re: xterm-color256: Different behavior between NetBSD 9.2 and 9.99.93?
> 
> On Thu, Feb 03, 2022 at 14:15:45 +0100, Martin Husemann wrote:
> 
> > Bug in the terminfo compiler?
> 
> http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/tic/tic.c#rev1.39
> 
> sounds like it might be related.

As I understand the code the 1.30 fix to promote older compiled
entries being included with "use=" shouldn't affect anything if the
source database is already in the newest format, no?

As I understand things, the problem is that tic(1) isn't incorporating
"use=" entries using the correct algorithm.

The value of the "colors" capability is just a part of the symptom.
Careful comparison of the "infocmp -1 xterm-256color" output from NetBSD
and from a system using ncurses should produce identical matching
output, but at the moment there are several differences and examining
the terminfo source file suggests, to me at least, that the order of
processing of the "use=" entries is wrong.

The proper algorithm, as I understand it is to scan right-to-left for
"use=" capabilities, and to rescan after each new entry has been
inserted to replace the "use=" capability.

This algorithm is fairly clearly described in the ncurses terminfo(5)
manual page, and in order to handle the ncurses terminfo source file
more-or-less as-is, one must presumably implement the ncurses "use="
merging algorithm faithfully.

These comments are as far as I've got in diagnosing things in the NetBSD
sources:

--- tic.c.~1.40.~	2020-05-30 17:44:04.000000000 -0700
+++ tic.c	2022-01-06 17:53:47.893092115 -0800
@@ -424,6 +424,7 @@
 		rtic = term->tic;
 		basename = _ti_getname(TERMINFO_RTYPE_O1, rtic->name);
 		promoted = false;
+		/* XXX this does the use= merging the wrong way!?!?!? */
 		while ((cap = _ti_find_extra(rtic, &rtic->extras, "use"))
 		    != NULL) {
 			if (*cap++ != 's') {
@@ -684,6 +685,7 @@
 	free(tbuf.buf);
 
 	/* Merge use entries until we have merged all we can */
+	/* XXX this doesn't do properly nested merging!!! */
 	while (merge_use(flags) != 0)
 		;
 

-- 
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>


Home | Main Index | Thread Index | Old Index