[英]ncurses on macOS (OSX) cannot find xterm-256color
我正在尝试在 macOS 上使用 ncurses 6.0。 我已经下载了该项目并使用提供的 makefile 构建了 C++ 演示。 但是,当我运行演示时,出现错误:
打开终端时出错:xterm-256color。
这可能是相关的:我的terminfo
目录中没有x
文件夹:
$ ls /usr/share/terminfo/
31 36 45 51 64 69 6e 73 78
32 37 4c 58 65 6a 6f 74 7a
33 38 4d 61 66 6b 70 75
34 39 4e 62 67 6c 71 76
35 41 50 63 68 6d 72 77
该演示在 Debian 上正常运行。
我的配置的输出是:
** Configuration summary for NCURSES 6.0 20150808:
extended funcs: yes
xterm terminfo: xterm-new
bin directory: /usr/local/bin
lib directory: /usr/local/lib
include directory: /usr/local/include/ncurses
man directory: /usr/local/share/man
terminfo directory: /usr/local/share/terminfo
** Include-directory is not in a standard location
因为我很懒惰并且不阅读手册,所以我没有运行完整的设置过程。 运行后:
./configure
make
make install
它现在可以工作了。
当您构建 ncurses 时,配置脚本会在最后告诉您它将安装在哪里。 如果您在 OSX 上不提供任何选项,它将如下所示:
creating headers.sh
** Configuration summary for NCURSES 6.0 20160409:
extended funcs: yes
xterm terminfo: xterm-new
bin directory: /usr/local/bin
lib directory: /usr/local/lib
include directory: /usr/local/include/ncurses
man directory: /usr/local/share/man
terminfo directory: /usr/local/share/terminfo
** Include-directory is not in a standard location
您可以覆盖 terminfo 目录的位置(读取INSTALL
文件),或者通过设置TERMINFO
和/或TERMINFO_DIRS
环境变量在运行时告诉库。 但是如果不做其中任何一件事情,它就会在不同的位置寻找终端数据库。
ncurses 配置脚本为某些系统(主要是基于 Linux 的)提供了一个--prefix=/usr
选项,因为它应该是系统 curses 库(再次阅读INSTALL
)。 OSX 在这里并不奇怪。
OSX 与通常情况不同:它的文件系统(通常)忽略大写/小写名称之间的差异。 configure 脚本会对此进行检查,如果是,它会在解决方法中进行编译,以将这些单个字母编码为十六进制数字。 例如, 0x78
是“x”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.