Linux

/etc/termcap linux 條目的來源

  • September 2, 2017

為什麼在 中描述了一種$TERM被呼叫的類型?為什麼以及何時創建它,它的意義何在?我們就不能呆在一起嗎?只是Linux 控制台的習慣名稱和一組功能(例如,或者是根目錄下的習慣名稱,沒人關心),還是在引入它時背後有任何技術原因?linux``/etc/termcap``vt-generic``linux``etc``home

終端描述以 Linux 命名,它提供自己的控制台仿真器(與其他幾個核心一樣)。

除了 FreeBSD,所有 Linux 和現代 BSD 平台都通過從ncurses中的 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非常古老(見於1995 年 11 月的1.9.7a),但並未過時:

   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 CONSOLE 和 SPECIAL TYPES,雖然沒有“vt-generic”描述,也沒有(考慮到變體之間的差異),是否有合理的選擇。

如果您尋找“vt-generic”,您可能會發現只有在不太流行的實現中,例如 Informix(見此文件):

#   @(#)/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.

進一步閱讀:

引用自:https://unix.stackexchange.com/questions/259426