简体   繁体   English

ncurses测试程序失败,并显示消息“打开终端错误:xterm”

[英]ncurses test programs failing with message “Error opening terminal: xterm”

(Note: this is similar to this question , but the answer there does not apply.) (注意:这类似于此问题 ,但那里的答案不适用。)

Running under FreeBSD, I have ncurses installed via the usual pkg method for FreeBSD, but because I've seen some odd behaviour with a previously working curses program, I decided to download an ncurses source tarball from the official site and compile it under my home directory. 在FreeBSD上运行时,我已经通过FreeBSD的常规pkg方法安装了ncurses,但是由于我已经看到了以前运行的curses程序的某些奇怪行为,因此我决定从官方站点下载ncurses源tarball并在我的家中编译目录。

The compile went fine, but attempting to run any of the included test programs results in: 编译进行得很好,但是尝试运行任何包含的测试程序会导致:

 Error opening terminal: xterm.

The documentation does say: 该文档确实说:

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. 注意:您必须已安装terminfo数据库,或将环境变量$ TERMINFO设置为指向SVr4兼容的terminfo数据库,然后再运行测试程序。 Not all vendors' terminfo databases are SVr4-compatible, but most seem to be. 并非所有供应商的terminfo数据库都是SVr4兼容的,但大多数似乎是兼容的。

So it looks like the answer is to set TERMINFO, but to what? 因此,看来答案是设置TERMINFO,但是要做什么呢? I don't see any terminfo database under the build directory itself, but I do have a file /usr/local/share/misc/terminfo.db installed as a result of the regular FreeBSD installation. 我没有在构建目录下看到任何terminfo数据库,但是由于常规的FreeBSD安装,我确实安装了/usr/local/share/misc/terminfo.db文件。

Nevertheless, setting (csh syntax) setenv TERMINFO /usr/local/share/misc/terminfo.db (or the same omitting the .db extension) doesn't make any difference. 但是,设置(csh语法) setenv TERMINFO /usr/local/share/misc/terminfo.db (或相同的省略.db扩展名)没有任何区别。

(Note: this shouldn't matter because I haven't so far attempted to install the local build, but when I ran "configure", I used: ./configure --prefix=$HOME so that it would install under my home directory. (注意:这无关紧要,因为到目前为止我还没有尝试安装本地版本,但是当我运行“ configure”时,我使用了: ./configure --prefix=$HOME以便它可以安装在我的家中目录。

By default, ncurses uses (reads/writes) a directory-tree of terminal descriptions. 默认情况下,ncurses使用(读取/写入)终端描述的目录树。 Optionally (and seen in the makefile for the ncurses port ), it reads/writes a hashed database file, as well as reads the directory-tree. (可选)( 在ncurses端口makefile中可见),它读取/写入哈希数据库文件,以及读取目录树。

The INSTALL file in the ncurses sources goes into some detail about the --with-hashed-db configure option, which you apparently overlooked. ncurses源代码中的INSTALL文件详细介绍了--with-hashed-db configure选项,您显然忽略了该选项。 The term(5) manual page gives a better overview. term(5)手册页提供了更好的概述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM