xref: /original-bsd/old/man/newtty.4 (revision 8af5b582)
Copyright (c) 1980 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.

@(#)newtty.4 4.1 (Berkeley) 05/15/85

NEWTTY 4 4/1/81
C 4
NAME
newtty - summary of the ``new'' tty driver
USAGE
"stty new"

"stty new crt"

DESCRIPTION
This is a summary of the new tty driver, described completely, with the old terminal driver, in tty (4). The new driver is largely compatible with the old but provides additional functionality for job control.

"CRTs and printing terminals."

The new terminal driver acts differently on CRTs and on printing terminals. On CRTs at speeds of 1200 baud or greater it normally erases input characters physically with backspace-space-backspace when they are erased logically; at speed under 1200 baud this is often unreasonably slow, so the cursor is normally merely moved to the left. This is the behavior when you say \*(lqstty new crt\*(rq; to have the tty driver always erase the characters say \*(lqstty new crt crterase crtkill\*(rq, to have the characters remain even at 1200 baud or greater say \*(lqstty new crt -crterase -crtkill\*(rq.

On printing terminals the command \*(lqstty new prterase\*(rq should be given. Logically erased characters are then echoed printed backwards between a `\e' and an `/' character.

Other terminal modes are possible, but less commonly used; see tty (4) and stty (1) for details.

"Input editing and output control."

When preparing input the character # (normally changed to ^H using stty (1)) erases the last input character, ^W the last input word, and the character @ (often changed to ^U) erases the entire current input line. A ^R character causes the pending input to be retyped. Lines are terminated by a return or a newline; a ^D at the beginning of a line generates an end-of-file.

Control characters echo as ^x when typed, for some x; the delete character is represented as ^?.

The character ^V may be typed before any character so that it may be entered without its special effect. For backwards compatibility with the old tty driver the character `\e' prevents the special meaning of the character and line erase characters, much as ^V does.

Output is suspended when a ^S character is typed and resumed when a ^Q character is type. Output is discarded after a ^O character is typed until another ^O is type, more input arrives, or the condition is cleared by a program (such as the shell just before it prints a prompt.)

"Signals."

A non-interactive program is interrupted by a ^? (delete); this character is often reset to ^C using stty (1). A quit ^\e character causes programs to terminate like ^? does, but also causes a core image file to be created which can then be examined with a debugger. This is often used to stop runaway processes. Interactive programs often catch interrupts and return to their command loop; only the most well debugged programs catch quits.

Programs may be stopped by hitting ^Z, which returns control to the shell. They may then be resumed using the job control mechanisms of the shell, i.e. the fg (foreground) command. The character ^Y is like ^Z but takes effect when read rather then when typed; it is much less frequently used.

See tty (4) for a more complete description of the new terminal driver.

"SEE ALSO"
csh(1), newcsh(1), stty(1), tty(4)