----- Original Message -----
| From: "Stuart Henderson" <[email protected]>
| To: "Sabrina Velasquez" <[email protected]>
| Cc: [email protected]
| Sent: Friday, January 1, 2021 9:18:31 AM
| Subject: Re: ncurses is outdated in OpenBSD

| On 2020/12/30 22:05, Sabrina Velasquez wrote:
|> Hello!
|> I had an issue with ambiguous behavior of tput setaf in OpenBSD.
|> If TERM=xterm, then tput setaf 1 works and changes foreground color to red,
|> but it only supports 8 colors.
|> If TERM=xterm-256color, then tput setaf 1 fails with error:
|> tput: not enough arguments (3) for capability `setaf'
| 
| I think this is a tput problem not an ncurses one. OpenBSD's tput is not
| from ncurses, it validates the number of arguments separately and that
| doesn't match what's actually needed by ncurses.
| 
| Workaround: use anything for the 2nd and 3rd parameters, both the
| OpenBSD and ncurses tput commands ignore these. e.g. tput setaf 1 1 1.
| 
| This has been noted before:
| https://marc.info/?l=openbsd-misc&m=144800414402238&w=2
| 
|> I've reached ncurses author and asked him about this issue.
|> His answer was:
|> "OpenBSD hasn't updated ncurses for the past 12 years"
| 
| That's not correct, it's only 11 years ;) (and it's not "pure" ncurses,
| it has local changes).

I'd forgotten that - but since it was produced by adapting code from ncurses, 
the point still holds.

Here's some context, showing the original code:

https://github.com/ThomasDickey/ncurses-snapshots/blob/4ea0089ed3027c29ad07bb2cc016f81c04c4b2dc/ncurses/lib_tparm.c#L274

https://github.com/ThomasDickey/ncurses-snapshots/blob/4ea0089ed3027c29ad07bb2cc016f81c04c4b2dc/progs/tput.c

https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/tput/tput.c.diff?r1=1.7&r2=1.8&f=h


-- 
Thomas E. Dickey <[email protected]>
http://invisible-island.net
ftp://ftp.invisible-island.net

Reply via email to