[Chapter 41] Terminal and Serial Line Settings
Author: Jerry Peek, Tim O'Reilly & Mike Loukides
Date: 1998-08-04T21:51:47Z

#

| Chapter 41 |

# 41. Terminal and Serial Line Settings

Contents:
Delving a Little Deeper
stty and All That Stuff
Find Out Terminal Settings with stty
How UNIX Handles TAB Characters
Why Some Systems Backspace over Prompts
Using sleep to Keep Port Settings
Reading Verrrry Long Lines from the Terminal
ptys and Window Systems
Commands to Adjust Your Terminal
Using terminfo Capabilities in Shell Programs
How termcap and terminfo Describe Terminals
Finding Out What Characters Your Terminal's Special Keys Send

## 41.1 Delving a Little Deeper

Article 5.2 and others introduce parts of UNIX terminal handling. This chapter contains several articles that show a little more about how UNIX handles terminals and other serial devices. Beginners don't always realize that there are several overlapping mechanisms at work. Programs like tset and tput, and the termcap and terminfo databases they depend on, actually configure the terminal or window (or tell other programs about their characteristics), while stty affects the operation of the UNIX device drivers that handle the serial line. From a user's point of view, the distinction isn't always clear, especially since tset does some of its work on both levels.

Perhaps we're continuing the confusion by putting information about both of these topics into the same chapters. Oh well. What we have here are a miscellany of topics that delve a little deeper than we've gone before into how terminals work under UNIX.

- Article 41.2 explains why stty is as complex as it is. Article 41.3 shows how to check stty's settings.

- Article 41.4 explains some of the mysteries of terminal tab handling.

- Article 41.5 lists differences in the way that System V and BSD UNIX handle what you type on the command line.

- Articles 41.6 and 41.7 give two tips about stty.

- Article 41.8 explains how software designed for terminals still runs under window systems, using "pseudo-terminals" or ptys.

- Articles 41.9 and 41.10 describe how to issue escape sequences to change the behavior of your terminal.

- Article 41.11 describes how to read a termcap or terminfo entry.

- Article 41.12 describes how to avoid reading termcap and terminfo entries.

- Article 42.1 introduces more low-level concepts.

- TOR

VII. Terminals and Printers |  | 41.2 stty and All That Stuff