Previous: , Up: Overview   [Contents][Index]


1.2 Use Scenarios of ctlseqs

Control sequences, as well as other control functions, were once commonly used in computer terminals. Terminals exchange control information with the host regarding colors, font styles, cursor position, etc., using control functions embedded in normal text. Such physical terminals are no longer used today, however, popular ones like DEC VT100 are widely emulated by modern terminal emulators.

The primary purpose of the ctlseqs library is to provide developers with simple and easy-to-use API for handling control functions, when working on terminal emulators and text-based programs.

However, since there is no de facto standard, control functions used in terminals are largely vendor-specific, and terminal emulators like to add their own private controls. That makes ctlseqs not suitable for writing text-based programs which intend to be portable. Instead of raw control codes, developers should stick to ncurses or terminfo.

There are still cases when dealing with raw escape sequences is inevitable, and ctlseqs may come in handy: