NetBSD-Bugs archive

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

lib/58034: terminfo: tmux-direct different from ncurses version



>Number:         58034
>Category:       lib
>Synopsis:       terminfo: tmux-direct different from ncurses version
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 13 09:50:00 +0000 2024
>Originator:     Thomas Klausner
>Release:        NetBSD 10.99.10
>Organization:

>Environment:
	
	
Architecture: x86_64
Machine: amd64
>Description:
On NetBSD 10.99.10, the tmux-direct entry only has 8 colors instead
of the 16 million it should have.
>How-To-Repeat:
$ infocmp -1x tmux-direct
...
        colors#8,
...
        pairs#64,
...

The definition from the terminfo file is:
tmux-direct|tmux with direct-color indexing,
        use=kitty+setal, use=xterm+direct, use=tmux,

"kitty+setal" does not set colors:
$ infocmp -1x kitty+setal
# Reconstructed from /usr/share/misc/terminfo.cdb
kitty+setal|set underline colors (nonstandard),
        setal=\E[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,

"xterm+direct" does:
$ infocmp -1x xterm+direct
# Reconstructed from /usr/share/misc/terminfo.cdb
...
        colors#16777216,
...
        pairs#65536,
...

And since it's the second entry in the definition, this should win,
but it doesn't.

To complete the picture, "tmux" defines colors too:
$ infocmp -1x tmux
# Reconstructed from /usr/share/misc/terminfo.cdb
...
        colors#8,
...
        pairs#64,
...

The behaviour seems to work for simple case:
--- terminfotest ---
minfirst|TermInfo Test,
       use=min, use=max,
maxfirst|TermInfo Test,
       use=max, use=min,

max|any number > INT16_MAX,
       colors#16777216,

min|any num < INT16_MAX,
       colors#8,
--- end of terminfotest ---

> tic -x terminfotest
> infocmp -1x -A /home/wiz/terminfotest.cdb minfirst
# Reconstructed from /home/wiz/terminfotest.cdb
minfirst|TermInfo Test,
        colors#8,
> infocmp -1x -A /home/wiz/terminfotest.cdb maxfirst
# Reconstructed from /home/wiz/terminfotest.cdb
maxfirst|TermInfo Test,
        colors#16777216,


but breaks down when I add a third entry:
--- terminfotest2 ---
kitty+setal|set underline colors (nonstandard),
        setal=\E[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,

minfirst|TermInfo Test,
# if the second number is >32767, it disappears!
       use=min, use=max,
maxfirst|TermInfo Test,
# putting the bigger one first makes "promotion" happen.
       use=max, use=min,

max|any number > INT16_MAX,
       colors#16777216,

min|any num < INT16_MAX,
       colors#8,

kittymin|kitty+min,
        use=kitty+setal, use=min, use=max
kittymax|kitty+max,
        use=kitty+setal, use=max, use=min
--- end of terminfotest2 ---

> tic -x terminfotest2

> infocmp -1x -A /home/wiz/terminfotest2.cdb kittymin
# Reconstructed from /home/wiz/terminfotest2.cdb
kittymin|kitty+min,
        colors#8,
        setal=\E[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,
> infocmp -1x -A /home/wiz/terminfotest2.cdb kittymax
# Reconstructed from /home/wiz/terminfotest2.cdb
kittymax|kitty+max,
        colors#8,
        setal=\E[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%dm,

>Fix:
Yes, please.

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index