简体   繁体   English

tput:未知终端“xterm-256color”

[英]tput: unknown terminal “xterm-256color”

I'm running OS X 10.10.5. 我正在运行OS X 10.10.5。 I'm getting an error trying to open a terminal: 我在尝试打开终端时遇到错误:

tput: unknown terminal "xterm-256color" tput:未知终端“xterm-256color”

This is obviously a missing termcap entry. 这显然是一个缺少的termcap条目。

$ port list ncurses
ncurses                        @6.0            devel/ncurses

Any ideas how to install 'ncurses-term' on OS X? 有关如何在OS X上安装'ncurses-term'的想法?

$ sudo port install ncurses-term
Password:
Error: Port ncurses-term not found

The problem was with an Anaconda package: 问题在于Anaconda包:

https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/XKMFYqM12Vg

It appears there is some problem with an earlier version of the ncurses package that interferes with terminfo 似乎早期版本的ncurses软件包存在一些干扰terminfo的问题

conda install -c r ncurses 

Notwithstanding the existence of bloated/monolithic packages on Linux, the package maintainers for ncurses packages often split up the 7Mb of terminfo into "base" and "term" chunks (and separate it from the library). 尽管Linux上存在臃肿/单片软件包,但ncurses软件包的软件包维护者经常将7Mb的terminfo拆分为“base”和“term”块(并将其与库分开)。 The MacPorts maintainer for ncurses has not done this. 用于ncurses的MacPorts维护者还没有这样做。 The terminal database is part of the "ncurses" package. 终端数据库是“ncurses”包的一部分。 For instance, I see this from 例如,我从中看到了这一点

port contents ncurses@6.0_0+universal

under /opt: 在/ opt下:

/opt/local/share/terminfo/73/screen.xterm-256color

Also there is a system (non-port) copy here: 此处还有一个系统(非端口)副本:

/usr/share/terminfo/78/xterm-256color

Applications linked with ncurses will generally use one or the other, depending on whether they are linked with the port- or system-library. 与ncurses链接的应用程序通常使用其中一个,具体取决于它们是否与端口库或系统库链接。 However, ncurses can be told to look some other place by setting the TERMINFO variable. 但是,可以通过设置TERMINFO变量告诉ncurses查看其他位置。 If you happen to have copied some customization from another machine into your .bashrc , that could have set TERMINFO . 如果您碰巧将其他计算机中的某些自定义复制到.bashrc ,则可能已设置TERMINFO

By itself, tput gives no clue where it is looking for a terminal entry. 就其本身而言, tput不知道它在哪里寻找终端入口。 You can check the output from env to see if TERMINFO is set. 您可以检查env的输出以查看是否设置了TERMINFO The infocmp utility can show where it looks (since late 2011 ), using the -D option, eg, infocmp实用程序可以显示它的外观(自2011年底以来),使用-D选项,例如,

$ infocmp -D
/usr/local/ncurses/share/terminfo
/usr/share/terminfo
/opt/local/share/terminfo

By the way, OSX does not (barring some specialized ports) use termcap as such. 顺便说一下,OSX不会(禁止某些专门的端口)使用termcap It uses terminfo , as part of some given release of ncurses (see for example the manual page for tgetent ). 它使用terminfo ,作为某些给定版本的ncurses的一部分(参见例如tgetent的手册页)。

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

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