Knowledge

Terminal capabilities

Source ๐Ÿ“

260:
database content to find the database record for the target terminal type. The terminal type name index is, effectively, the Unix/POSIX filesystem's ordinary directory structure. Originally, Unix had severe performance problems with large directories containing many files, and thus terminfo uses a two-level structure, dividing up the directory entries by first letter into a series of subdirectories. More recent filesystem formats used on Unix systems don't suffer as much from such problems (because their on-disc directory structures are no longer simple arrays of entries, but are organized into trees or hash tables) and so the necessity for this design element, that still exists in modern terminfo implementations, has since disappeared.
157:. This database consists of a series of records (each of which consists of one or more lines in the file, joined by backslash characters at the ends of each line that continues onto a following one) each of which represents the capabilities of a particular terminal. The fields of the record comprise the terminal type name, or names, followed by a sequence of capabilities, separated by colons. The capability fields themselves fall into three groups: 46:) is capable of, but that a teletypewriter is not; such as moving the terminal's cursor to positions on the screen, clearing and scrolling all or parts of the screen, turning on and off attached printer devices, programming programmable function keys, changing display colours and attributes (such as 126:
with windows, dialogue boxes, buttons, labels, input fields, menus, and so forth. The intention is that this allows applications programs to be independent of actual terminal characteristics. They don't need to hardwire any control codes or escape sequences into their code, and so don't have
259:
The use of a machine-readable format was to avoid the unnecessary overhead, in applications programs using systems such as the termcap library, of repeatedly parsing the database content to read the fields of a record. The use of multiple files was to avoid the similar overhead of parsing the
170:
These comprise the control codes and escape sequences sent to the terminal in order for it to perform some action (not necessarily a display action). An example of one of the simplest is the output sequence to clear the screen, which may be the
282:(which is, presumably, the terminal by which the function denoted by the capability is to be performed). One of the simplest operations is clearing the screen. The name of the database field that stores the output sequence for this is 333:
to look up a different terminal type in the database, with a command-line option to the command. So, for example, to issue the reset sequence appropriate for the type of terminal named "vt100" in the database (usually a
164:
These comprise such things as the (nominal) number of rows and columns the terminal's display has, whether output automatically wraps onto the next line when it reaches the end of a line, and so forth.
224:
rmation") library was developed for System V systems. It uses a database stored in multiple files within a directory, which can be variously (on different Unices and POSIX-compatible systems)
243:
Unlike the termcap database, the terminfo database is compiled, a machine-readable database that is constructed from a human-readable source file format by a utility program,
298:
Another operation is initializing or resetting the terminal to a known default state (of character attributes, fonts, colours, and so forth). The commands for this are:
326: 193:
These comprise the control codes and escape sequences that the terminal sends to the host to represent various actions and events, such as
106:, these capabilities are encoded in databases that are configured by a system administrator and accessed from programs via the 691: 667: 640: 621: 597: 578: 555: 534: 513: 38:
that can be sent to or received from the terminal. The escape codes sent to the terminal perform various functions that a
247:. They can be decompiled from machine-readable form back to human-readable form by another utility program, 115: 22: 278:
command is used to look up a specific capability in the system's database, and output it to the command's
50:), and setting display title strings. The escape codes received from the terminal signify things such as 686: 251:. The command to output the human-readable form of the "vt100" terminal definition, for example, is: 103: 123: 30:, that host systems (and the programs that run on them) can make use of. They are (mainly) of 338:
terminal), irrespective of terminal type specified in environment variables, the command is:
322: 184: 611: 153:
abilities") library was developed for BSD systems. It uses a database stored in the file
8: 567: 524: 237: 663: 636: 617: 593: 574: 551: 545: 530: 509: 43: 279: 122:
libraries, by which applications programs use the terminal capabilities to provide
39: 607: 27: 26:
are various terminal features, above and beyond what is available from a pure
680: 47: 194: 179:) character on some types of terminal but may, say, be the escape sequence 51: 31: 127:
problems being used on a range of terminals with a range of capabilities.
35: 83: 79: 471: 469: 263: 198: 172: 55: 466: 211: 107: 75: 71: 67: 59: 481: 327:
controlling environment variables of the POSIX terminal interface
136: 119: 111: 63: 616:. Addison-Wesley professional computing series. Addison-Wesley. 87: 335: 114:
library), upon which in turn are built libraries such as the
99: 93: 573:. A nutshell handbook (3rd ed.). O'Reilly Media, Inc. 269: 662:. Nutshell handbook (3rd ed.). O'Reilly Media, Inc. 429: 427: 402: 400: 387: 385: 383: 381: 379: 366: 364: 362: 360: 657: 236:. (Its location isn't even uniform across different 456: 454: 424: 412: 397: 376: 439: 357: 566: 264:Utility programs to exercise terminal capabilities 451: 678: 658:Strang, John; Mui, Linda; O'Reilly, Tim (1991). 318:command uses the terminal type specified by the 167:control sequences sent as output to the terminal 633:Solaris 8 Advanced System Administrator's Guide 547:UNIX system V release 4: the complete reference 190:control sequences sent as input by the terminal 329:. This can be overridden, however, to force 526:Linux Command Line and Shell Scripting Bible 94:Unix and POSIX: termcap, terminfo, et al. 16:In computing and telecommunications, the 606: 475: 679: 630: 564: 543: 487: 433: 418: 406: 391: 587: 529:. Bible Series. John Wiley and Sons. 503: 445: 370: 351: 522: 506:UNIX unbounded: a beginning approach 460: 110:library (which supersedes the older 102:-compliant systems that support the 635:(3rd ed.). Prentice Hall PTR. 13: 651: 286:, so the command arguments to the 14: 703: 590:Encyclopaedia of Operating System 290:program to clear the screen are 592:. Anmol Publications PVT. LTD. 569:Essential system administration 508:(5th ed.). Prentice Hall. 496: 161:characteristics of the terminal 1: 346: 692:Telecommunications equipment 183:on a terminal that requires 7: 613:The art of Unix programming 205: 10: 708: 267: 209: 134: 130: 58:, and other special key ( 544:Coffin, Stephen (1991). 490:, p. 244–245. 478:, p. 144–145. 340: 308: 300: 292: 253: 104:POSIX terminal interface 631:Winsor, Janice (2001). 550:. Osborne McGraw-Hill. 234:/usr/share/lib/terminfo 124:textual user interfaces 42:terminal (and software 588:Kumar, Sudhir (2004). 565:Frisch, ร†leen (2002). 523:Blum, Richard (2008). 238:distributions of Linux 274:On Unix systems, the 268:Further information: 185:ANSI escape sequences 660:Termcap and terminfo 504:Afzal, Amir (2008). 323:environment variable 230:/usr/share/terminfo 687:Computer terminals 352:What supports what 98:In Unix and other 44:terminal emulators 669:978-0-937175-22-4 642:978-0-13-027703-9 623:978-0-13-142901-7 599:978-81-261-1792-5 580:978-0-596-00343-2 557:978-0-07-881653-6 536:978-0-470-25128-7 515:978-0-13-119449-6 342:tput-Tvt100reset 226:/usr/lib/terminfo 699: 673: 646: 627: 608:Raymond, Eric S. 603: 584: 572: 561: 540: 519: 491: 485: 479: 473: 464: 458: 449: 443: 437: 431: 422: 416: 410: 404: 395: 389: 374: 368: 332: 321: 317: 289: 277: 250: 246: 235: 231: 227: 156: 144: 86:, and so forth) 707: 706: 702: 701: 700: 698: 697: 696: 677: 676: 670: 654: 652:Further reading 649: 643: 624: 600: 581: 558: 537: 516: 499: 494: 486: 482: 474: 467: 459: 452: 444: 440: 432: 425: 417: 413: 405: 398: 390: 377: 369: 358: 354: 349: 344: 343: 330: 319: 315: 312: 311: 304: 303: 296: 295: 287: 285: 280:standard output 275: 272: 266: 257: 256: 248: 244: 233: 229: 225: 216:The terminfo (" 214: 208: 182: 178: 154: 142: 139: 133: 96: 12: 11: 5: 705: 695: 694: 689: 675: 674: 668: 653: 650: 648: 647: 641: 628: 622: 604: 598: 585: 579: 562: 556: 541: 535: 520: 514: 500: 498: 495: 493: 492: 480: 465: 450: 448:, p. 417. 438: 436:, p. 769. 423: 421:, p. 372. 411: 409:, p. 115. 396: 394:, p. 770. 375: 373:, p. 419. 355: 353: 350: 348: 345: 341: 309: 301: 293: 283: 265: 262: 254: 210:Main article: 207: 204: 203: 202: 201:being pressed. 191: 188: 180: 176: 168: 165: 162: 135:Main article: 132: 129: 95: 92: 28:teletypewriter 9: 6: 4: 3: 2: 704: 693: 690: 688: 685: 684: 682: 671: 665: 661: 656: 655: 644: 638: 634: 629: 625: 619: 615: 614: 609: 605: 601: 595: 591: 586: 582: 576: 571: 570: 563: 559: 553: 549: 548: 542: 538: 532: 528: 527: 521: 517: 511: 507: 502: 501: 489: 484: 477: 472: 470: 463:, p. 31. 462: 457: 455: 447: 442: 435: 430: 428: 420: 415: 408: 403: 401: 393: 388: 386: 384: 382: 380: 372: 367: 365: 363: 361: 356: 339: 337: 328: 325:, one of the 324: 314:Normally the 307: 299: 291: 281: 271: 261: 255:infocmpvt100 252: 241: 239: 223: 219: 213: 200: 196: 195:function keys 192: 189: 186: 174: 169: 166: 163: 160: 159: 158: 152: 148: 138: 128: 125: 121: 117: 113: 109: 105: 101: 91: 89: 85: 81: 77: 73: 69: 65: 61: 57: 53: 49: 48:reverse video 45: 41: 37: 33: 32:control codes 29: 25: 24: 19: 659: 632: 612: 589: 568: 546: 525: 505: 497:Sources used 483: 476:Raymond 2004 441: 414: 313: 305: 297: 273: 258: 242: 221: 217: 215: 155:/etc/termcap 150: 146: 140: 97: 52:function key 36:escape codes 21: 18:capabilities 17: 15: 488:Winsor 2001 434:Frisch 2002 419:Coffin 1991 407:Coffin 1991 392:Frisch 2002 681:Categories 446:Kumar 2004 371:Afzal 2008 347:References 310:tputreset 294:tputclear 232:, or even 199:arrow keys 88:keystrokes 84:delete key 80:insert key 461:Blum 2008 336:DEC VT100 302:tputinit 173:form feed 56:arrow key 610:(2004). 212:terminfo 206:terminfo 108:terminfo 76:PgDn key 72:PgUp key 68:help key 60:home key 23:terminal 249:infocmp 175:(ASCII 143:termcap 137:termcap 131:termcap 120:ncurses 112:termcap 64:end key 666:  639:  620:  596:  577:  554:  533:  512:  145:(for " 116:curses 284:clear 220:inal 149:inal 100:POSIX 20:of a 664:ISBN 637:ISBN 618:ISBN 594:ISBN 575:ISBN 552:ISBN 531:ISBN 510:ISBN 331:tput 320:TERM 316:tput 306:and 288:tput 276:tput 270:tput 222:info 218:term 197:and 147:term 141:The 118:and 34:and 245:tic 240:.) 181:โ›2J 151:cap 40:CRT 683:: 468:^ 453:^ 426:^ 399:^ 378:^ 359:^ 228:, 177:FF 90:. 82:, 78:, 74:, 70:, 66:, 62:, 54:, 672:. 645:. 626:. 602:. 583:. 560:. 539:. 518:. 187:.

Index

terminal
teletypewriter
control codes
escape codes
CRT
terminal emulators
reverse video
function key
arrow key
home key
end key
help key
PgUp key
PgDn key
insert key
delete key
keystrokes
POSIX
POSIX terminal interface
terminfo
termcap
curses
ncurses
textual user interfaces
termcap
form feed
ANSI escape sequences
function keys
arrow keys
terminfo

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

โ†‘