Open herrhotzenplotz opened 5 days ago
What happens when you do export TERM=contour
inside the shell?
Also, we are trying to set TERM to contour while starting terminal, so maybe terminfo file is missing, and exort TERM=contour
will tell you about it
What happens when you do
export TERM=contour
inside the shell?
Of course that works. It's just annoying that everytime I use an ncurses application it starts up in black/white and scrolling in less(1)
is dead-slow. Then you quit said application, update your environment and start over.
Also, we are trying to set TERM to contour while starting terminal, so maybe terminfo file is missing
the terminfo is installed correctly:
nico@hades:~ $ find /usr/local/share/terminfo/
/usr/local/share/terminfo/
/usr/local/share/terminfo/c
/usr/local/share/terminfo/c/contour
/usr/local/share/terminfo/c/contour-latest
nico@hades:~ $
and
exort TERM=contour
will tell you about it
running export TERM=...
will tell you nothing. It just sets the shell variable and then exports it to the environment. Unless this is something shell/OS-specific.
Thanks @herrhotzenplotz, will try to figure out what is happening
When you export TERM, shell checks if you can set it
➜ ~ export TERM=asdfasdf
zsh: can't find terminal definition for asdfasdf
You're assuming that I am using zsh. However I am using FreeBSD's /bin/sh
(which itself is an enhanced version of ash
).
You're assuming that I am using zsh. However I am using FreeBSD's
/bin/sh
(which itself is an enhanced version ofash
).
oh, right, i forgot that this is only zsh implementation
Ok, after some debugging and reading I figured out that the problem is that contour has a hardcoded terminfo search path for /usr/share/terminfo
.
It completely ignores its installation prefix which is where the CMakeLists.txt outputs the compiled terminfo file.
So, rather looking for /usr/share/terminfo
(which doesn't even exist on FreeBSD) it should be looking in ${PREFIX}/share/terminfo
.
This will also fix the problem on other BSDs.
This is from man tic
Libraries that read terminfo entries are expected to check in succession
• a location specified with the TERMINFO environment variable,
• $HOME/.terminfo,
• directories listed in the TERMINFO_DIRS environment variable,
• a compiled-in list of directories (/usr/share/terminfo), and
• the system terminfo database (/usr/share/terminfo).
If you have a custom path for terminfo files add it into TERMINFO_DIRS
If you have a custom path for terminfo files add it into
TERMINFO_DIRS
It is not a custom path. The manual page you're looking at is generated at the build time of ncurses. Here I get the following:
The results are normally placed in the system terminfo database
/usr/local/share/terminfo. The compiled terminal description can be
placed in a different terminfo database. There are two ways to achieve
this:
• First, you may override the system default either by using the -o
option, or by setting the variable TERMINFO in your shell
environment to a valid database location.
• Secondly, if tic cannot write in /usr/local/share/terminfo or the
location specified using your TERMINFO variable, it looks for the
directory $HOME/.terminfo (or hashed database $HOME/.terminfo.db);
if that location exists, the entry is placed there.
Libraries that read terminfo entries are expected to check in
succession
• a location specified with the TERMINFO environment variable,
• $HOME/.terminfo,
• directories listed in the TERMINFO_DIRS environment variable,
• a compiled-in list of directories
(/usr/local/share/terminfo:/usr/local/share/site-terminfo), and
• the system terminfo database (/usr/local/share/terminfo).
The Fetching Compiled Descriptions section in the terminfo(5) manual
goes into further detail.
(this is from the man page installed from ports)
Linux systems generally dump everything in /usr
. *BSD-Systems among other Unix systems split out things under different prefixes for some neat seperation. As for FreeBSD, ports and binary packages are installed in /usr/local
, on NetBSD pkgsrc typically installs into /usr/pkg
.
Every terminal emulator in ports (that I use and have used) installs its terminfo files under $PREFIX/share/terminfo
and it works flawlessly.
Note that there is also a system-provided tic
in /usr/bin/tic
and it has the same paths as you noted above.
However since we're building contour as a package we want the terminfo not to leak outside the prefix and it should thus be installed in /usr/local/share/terminfo
and contour should, just like any other terminal emulator, look there.
Will it be sufficient then if we add /usr/local/share/terminfo
in one of the possible locations of terminfo ?
When I use a default-generated config file the declared
TERM
environment variable is ignored. This manifests in that whenever one launches contourTERM
is set tovt100
.OS
FreeBSD hades 14.1-RELEASE-p2 FreeBSD 14.1-RELEASE-p2 releng/14.1-n267685-73905162d0ab GENERIC amd64
contour version
0.5.0.7168
I built contour through my FreeBSD Port at https://github.com/herrhotzenplotz/ports-overlay/tree/master/x11/contour/.