Rust errors (rust-terminfo) lack color on FreeBSD #48574
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
O-freebsd
Operating system: FreeBSD
FreeBSD only provides a /etc/termcap file, not any of the terminfo directory structures searched for in https://github.com/rust-lang/rust/blob/master/src/libterm/terminfo/searcher.rs. The parser would need to learn to read the plaintext hashed file format of /etc/termcap rather than the terminfo binary read it does at https://github.com/rust-lang/rust/blob/master/src/libterm/terminfo/parser/compiled.rs#L188.
Installing the devel/ncurses port does not fix this directly since it is compiled to generate a /usr/local/share/misc/terminfo.db file rather than the directory structure expected at /usr/share/misc/terminfo. rust-terminfo lacks support for both the
terminfo.db
format and the /usr/local path. Not that those should be fixed.A workaround is to modify its Makefile and change
--with-hashed-db
to--without-hashed-db
, remove the terminfo.db staging, install, and then symlink the /usr/local/share_terminfo path to /usr/share/terminfo. This is simply a workaround though. The port should not be a requirement for rust on FreeBSD just for colors.I'm exploring installing /usr/share/terminfo on FreeBSD but it may not happen as it's not as trivial as it sounds. There's a
cap_mkdb
tool that is ran when/etc/termcap
is modified that will need to be expanded to runtic
(which isn't installed now). But worse is that it's entirely possible to not runcap_mdb
at all when modifying /etc/termcap so the /usr/share/terminfo directory entries could be wrong. It seems more reliable to just add support for reading /etc/termcap in rust-terminfo.For reference, there was a discussion in FreeBSD a few years ago about why termcap was still being used. No one really objected and Thomas Dickey of terminfo happened to chime in as well (https://lists.freebsd.org/pipermail/freebsd-arch/2014-February/015081.html).
The text was updated successfully, but these errors were encountered: