The S-Lang library, written by John E. Davis, provides midlevel access to terminals. It encapsulates all the low-level terminal handling through a set of routines that allow direct access to the video terminal and automatically handle scrolling and color. Although little direct support for windows is present and no widgets (or controls) are available in the S-Lang library, S-Lang provides a suitable base for such services.
 One of the authors of this book has written a higher-level windowing toolkit based on S-Lang called newt, which is included with most Linux distributions.
S-Lang is also available under DOS, which makes it attractive for applications that must be built for both Unix and DOS platforms. John E. Davis based his jed editor on S-Lang, allowing it to work on a wide variety of platforms, including DOS.
S-Lang's terminal handling abilities fall into two categories. First, it provides a set of functions for reading keystrokes from the terminal in a controlled manner. Second, it provides routines for full-screen output to the terminal. These routines hide many terminal capabilities from the programmer but still take advantage of each terminal's abilities. This chapter discusses how to use S-Lang in each of these capacities and ends with an example program that uses both.
 As described by the terminfo database.