为什么有一种$TERM
称为linux
描述的类型/etc/termcap
?它为何、何时创建以及它的意义是什么?我们就不能留下来吗vt-generic
?只是linux
Linux 控制台的一个习惯名称和一组功能(例如,etc
或者home
是 root 下目录的习惯名称,没有人关心),还是在引入它时有任何技术原因?
答案1
终端描述以 Linux 命名,它提供了自己的控制台模拟器(其他几个内核也是如此)。
除了 FreeBSD 之外,所有 Linux 和现代 BSD 平台都通过从 terminfo 数据库派生来获得“termcap”恩诅咒。控制台条目特定于它们所实现的系统(与许多运行在多个平台上的终端仿真器不同)。
ncurses 1.8.6(1994 年 10 月)中关于终端描述的评论linux
指出:
# 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
非常古老(见1.9.7a1995 年 11 月),但并没有过时:
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-generic”描述,也没有(考虑到变体之间的差异),但是否有一个合理的选择。
如果你看对于“vt-generic”,您可能会发现仅在不太流行的实现中,例如 Informix(参见此文件):
# @(#)/etc/termcap 0.0
#
# Informix product aware termcap file
#
# Author: Marco Greco, <[email protected]>, 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: [email protected] (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.
进一步阅读: