[Bug 291519] Suggest update to the termcap database in x11/ghostty

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 09 Apr 2026 04:38:28 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291519

Navdeep Parhar <np@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |np@FreeBSD.org

--- Comment #11 from Navdeep Parhar <np@FreeBSD.org> ---
tl;dr: I think we should add an xterm-ghostty entry to terminfo-db to get color
everywhere.


I tried ghostty recently and observed that color was available on the system
where ghostty was installed but not on other systems that I ssh'd to.  I poked
around with truss and tput a bit and I see that our terminal utils/libs consult
both terminfo and termcap, in that order.  ghostty sets TERM to xterm-ghostty
and color is available when the full terminfo entry for xterm-ghostty is
available.  If not then we fall back to the termcap db and the partial entry
for ghostty/xterm-ghostty that doesn't support color.

All good when ghostty is installed:
$ pkg list ghostty | grep terminfo
/usr/local/share/site-terminfo/g/ghostty
/usr/local/share/site-terminfo/x/xterm-ghostty

But our terminfo-db package is missing the entry for xterm-ghostty.  So if you
ssh to a system where ghostty is not installed, you don't get color even though
your have terminfo-db installed.  booo.
$ pkg list terminfo-db | grep ghost
/usr/local/share/terminfo/g/ghostty


Here's a demo of the problem:

# pkg remove terminfo-db ghostty
$ TERM=ghostty tput colors
-1
$ TERM=xterm-ghostty tput colors
-1

Colors for TERM=ghostty (only) when terminfo-db is available.
# pkg install terminfo-db
$ TERM=ghostty tput colors
256
$ TERM=xterm-ghostty tput colors
-1

-- 
You are receiving this mail because:
You are the assignee for the bug.