A generic terminal-handling mechanism that consists of a database that describes the capabilities of each terminal to be supported and a subroutine library that allows programs to query that database and to make use of the capability values it contains.
Terminals come in many, many, flavours and types. Their peculiarities are described by a termcap file, allowing SM's command editor to run on (almost) any terminal.