ncurses 测试程序失败并显示消息 "Error opening terminal: xterm"
ncurses test programs failing with message "Error opening terminal: xterm"
(注意:这类似于,但那里的答案不适用。)
运行 在 FreeBSD 下,我通过 FreeBSD 的常用 pkg 方法安装了 ncurses,但是因为我看到以前工作的 curses 程序有一些奇怪的行为,我决定从下载一个 ncurses 源 tarball官方网站并在我的主目录下编译它。
编译顺利,但尝试 运行 任何包含的测试程序会导致:
Error opening terminal: xterm.
文档确实说:
NOTE: You must have installed the terminfo database, or set the
environment variable $TERMINFO to point to a SVr4-compatible terminfo
database before running the test programs. Not all vendors' terminfo
databases are SVr4-compatible, but most seem to be.
所以看起来答案是设置 TERMINFO,但是设置什么?我在构建目录本身下没有看到任何 terminfo 数据库,但我确实安装了一个文件 /usr/local/share/misc/terminfo.db
作为常规 FreeBSD 安装的结果。
然而,设置(csh 语法)setenv TERMINFO /usr/local/share/misc/terminfo.db
(或相同的省略 .db
扩展名)没有任何区别。
(注意:这应该无关紧要,因为到目前为止我还没有尝试安装本地版本,但是当我 运行 "configure" 时,我使用了:./configure --prefix=$HOME
所以它将安装在我的主目录下。
默认情况下,ncurses 使用 (reads/writes) 终端描述目录树。可选(并在 makefile for the ncurses port 中看到),它 reads/writes 一个哈希数据库文件,以及读取目录树。
INSTALL file in the ncurses sources goes into some detail about the --with-hashed-db
configure option, which you apparently overlooked. The term(5) 手册页提供了更好的概述。
(注意:这类似于
运行 在 FreeBSD 下,我通过 FreeBSD 的常用 pkg 方法安装了 ncurses,但是因为我看到以前工作的 curses 程序有一些奇怪的行为,我决定从下载一个 ncurses 源 tarball官方网站并在我的主目录下编译它。
编译顺利,但尝试 运行 任何包含的测试程序会导致:
Error opening terminal: xterm.
文档确实说:
NOTE: You must have installed the terminfo database, or set the environment variable $TERMINFO to point to a SVr4-compatible terminfo database before running the test programs. Not all vendors' terminfo databases are SVr4-compatible, but most seem to be.
所以看起来答案是设置 TERMINFO,但是设置什么?我在构建目录本身下没有看到任何 terminfo 数据库,但我确实安装了一个文件 /usr/local/share/misc/terminfo.db
作为常规 FreeBSD 安装的结果。
然而,设置(csh 语法)setenv TERMINFO /usr/local/share/misc/terminfo.db
(或相同的省略 .db
扩展名)没有任何区别。
(注意:这应该无关紧要,因为到目前为止我还没有尝试安装本地版本,但是当我 运行 "configure" 时,我使用了:./configure --prefix=$HOME
所以它将安装在我的主目录下。
默认情况下,ncurses 使用 (reads/writes) 终端描述目录树。可选(并在 makefile for the ncurses port 中看到),它 reads/writes 一个哈希数据库文件,以及读取目录树。
INSTALL file in the ncurses sources goes into some detail about the --with-hashed-db
configure option, which you apparently overlooked. The term(5) 手册页提供了更好的概述。