[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -2 in numeric and string capabilities
From: |
Thomas Dickey |
Subject: |
Re: -2 in numeric and string capabilities |
Date: |
Mon, 20 Jul 2020 20:19:32 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Jul 20, 2020 at 08:54:00PM +0200, Florian Weimer wrote:
> term(5) says this:
>
> | Short integers are stored in two 8-bit bytes. The first byte contains
> | the least significant 8 bits of the value, and the second byte
> | contains the most significant 8 bits. (Thus, the value represented is
> | 256*second+first.) The value -1 is represented by the two bytes 0377,
> | 0377; other negative values are illegal. […]
> |
> | The numbers section is similar to the flags section. Each capability
> | takes up two bytes, and is stored as a little-endian short integer.
> | If the value represented is -1, the capability is taken to be
> | missing.
> |
> | The strings section is also similar. Each capability is stored as a
> | short integer, in the format above. A value of -1 means the
> | capability is missing. Otherwise, the value is taken as an offset
> | from the beginning of the string table. […]
>
> But the value -2 occurs in practice, too.
in a terminal description?
perhaps not - tic won't accept a negative value.
...if it did, that would be a bug
...of course, someone could put the bits together without the tool :-)
> It seems to me that these represent “canceled” capabilities, which
> appear to be an internal implementation detail of the terminfo
> compiler. I expect that applications should treat them as absent, so
> like -1. But this should probably be mentioned in term(5).
yes... that should match up with the description of tput(1)...
(on to-do list)
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature