首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >/etc/termcap条目的来源

/etc/termcap条目的来源
EN

Unix & Linux用户
提问于 2016-02-02 21:17:08
回答 1查看 1.6K关注 0票数 7

为什么在$TERM中有一种名为linux/etc/termcap?它是为什么什么时候被创造的,它的意义是什么?我们就不能和vt-generic待在一起吗?linux只是一个习惯名称和一组用于Linux控制台的功能(比如,etchome是根目录的习惯名称,没有人关心),还是在引入它时有什么技术原因?

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2016-02-02 21:44:07

终端描述是为Linux命名的,Linux提供了自己的控制台模拟器(其他几个内核也是如此)。

除了FreeBSD之外,所有的Linux和现代BSD平台都是通过从诅咒中的terminfo数据库中派生出来的。控制台条目是特定于实现它们的系统的(与运行在多个平台上的许多终端模拟器不同)。

linux终端描述的ncurses 1.8.6 (1994年10月)中的评论指出:

代码语言:javascript
复制
# Note that the statdard Linux console is now called 'linux' instead
# of 'console'. terminals with sizes other than 80x25 need to append
# their size to linux and add an entry like the one for 132x43 below

这是Linux特有的,但是随着ncurses的移植,泛化也随之出现。

在ncurses源代码中,INSTALL的这一部分非常古老(1995年11月在1.9.7a中见过),但并没有过时:

代码语言:javascript
复制
    Naming the Console Terminal                                            

    In various systems there has been a practice of designating the system
    console driver type as `console'.  Please do not do this!  It
    complicates peoples' lives, because it can mean that several different
    terminfo entries from different operating systems all logically want to
    be called `console'.

    Please pick a name unique to your console driver and set that up
    in the /etc/inittab table or local equivalent.  Send the entry to the
    terminfo maintainer (listed in the misc/terminfo file) to be included
    in the terminfo file, if it's not already there.  See the
    term(7) manual page included with this distribution for more on
    conventions for choosing type names.

    Here are some recommended primary console names:

            linux   -- Linux console driver
            freebsd -- FreeBSD
            netbsd  -- NetBSD
            bsdos   -- BSD/OS

    If you are responsible for integrating ncurses for one of these
    distributions, please either use the recommended name or get back
    to us explaining why you don't want to, so we can work out nomenclature
    that will make users' lives easier rather than harder.

终端数据库中有这样一个部分:ANSI、UNIX控制台和特殊类型,虽然没有“vt-泛型”描述,也没有(考虑到不同版本之间的差异),但没有一个合理的选择。

如果您查找“vt-泛型”,很可能您会发现只有在诸如Informix这样的较不流行的实现中(在本文件中可以看到):

代码语言:javascript
复制
#   @(#)/etc/termcap    0.0 
#
#   Informix product aware termcap file
#
#   Author: Marco Greco, <marcog@ctonline.it>, Catania, Italy
#
#   Initial release: Jun 97
#   Current release: Jul 98
#
#   Absolutely no warranty -- use at your own risk
#
#   Notes: Adapted from the default Slackware termcap file:
#   added gs, ge, gb, ZG, ZA capabilities, shifted function keys
#   down by one, added ki, kj, kf, kg
#
#   Limit the size of each entry - 4gl apps core dump if applicable
#   entry too long
#
#   Entries other than vt's, console & xterm *untested*
#
# From: miquels@drinkel.ow.org (Miquel van Smoorenburg)
#
# Okay guys, here is a shorter termcap that does have most
# capabilities and is ncurses compatible. If it works for you
# I'd like to hear about it.

进一步读:

票数 11
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/259426

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档