|Previous||Table of Contents||Next|
|The value of c may be set to NULL (undefined) by using "u" or "undef."|
|quit||Same as SV|
|brk c||Set the break character to c. The default is NULL (undefined).|
|Sets the number of columns assumed on the terminal to n.|
|rows n||Sets the number of rows assumed on the terminal to n.|
|start c||Set the start character to c. The default is Ctrl-Q. This allows you to start output to your terminal that has been stopped by the stop character (Ctrl-S).|
|stop c||Set the stop character to c. The default is Ctrl-S. This allows you to stop output to your terminal.|
|tilde (-tilde)||(Do not) Convert the tilde character (~) to acute accent (`).|
Combination Modes The following terminal options are aliases for common combinations of previously defined terminal options.
|nl||Unsets the incrnl and onlcr terminal options.|
|-nl||Sets incrnl and onlcr and unsets inlcr, igncr, ocrnl, and onlret.|
|Sets (unsets) the xcase, iuclc, and olcuc terminal options.|
(-tabs or tab8)
|Expands tabs to the equivalent number of spaces when on output.|
|ek||Resets the kill character to @ and the erase character to #.|
|sane||Resets the tty device driver terminal options to some reasonable values. This is useful if you have to kill a program with a kill -9 PID command and the program has reset some of the terminal options.|
(-raw or cooked)
|Same as SV|
|crt||Sets options for a CRT. The crtbs, crtecho (if the baud rate >=1200), crterase, and crtkill are set.|
|dec||Sets all modes suitable for Digital Equip. Corp. users (erase=Ctrl-?, kill=Ctrl-U, intr=Ctrl-C, and the decctlq and newcrt modes are set).|
NEW TTY DRIVER MODES
The following modes (tty settings) are only applicable to the new BSD tty device driver. Usually they are not changed. The new device driver is used by specifying stty new.
|susp c||Set the suspend process character to c. The default is Ctrl-Z.|
|dsup c||Set the delayed suspend process character to c. The default is Ctrl-Y.|
|rprnt c||Set the reprint line character to c. The default is Ctrl-R. Redraws the command line. Useful when output from a background job or other user has garbled your command line.|
|flush c||Set the flush output character to c. The default is Ctrl-O. Flushes all currently held output to your terminal.|
|werase c||Set the erase word character to c. The default is Ctrl-W. If you press the Ctrl-W on the command line, the previous word is erased.|
|inext c||Set the literal next character to c. The default is Ctrl-V. This allows you to enter a character with special meaning to the device driver on the command line. For example, Ctrl-R normally redraws the command line. But Ctrl-V Ctrl-R inserts the Ctrl-R on the command line.|
Refer to the tabs command described in Module 130.
The stty command sends control signals to the device driver you are currently logged into the system through.
The stty command has many options you can use to change how the computer system communicates with your terminal. Most of the terminal options described are set automatically to the proper setting. You can, however, reset some of the options to customize how the system communicates with your terminal. For example, the local modes, control characters, and the combination modes are often used to reset how the terminal device driver functions, thus changing how the terminal acts.
The most common use of the stty command is to reset your erase and kill characters. Some people reset a few other options but, for the most part, the default settings handle all of the typical user's requirements.
The echo option is sometimes used in shell scripts to turn off echoing when you want to read in a password or some type of encryption key and you do not want the input to be displayed on the screen. For example,
cj> cat readpasswd stty -echo echo "Enter database password: \c" read PSWD stty echo
might be used to read in a password without having the password displayed while it is being typed by the user.
The stty command may also be used by the super-user to change the settings of a tty other than the one currently logged in on. For example,
cj> stty 9600 < /dev/tty09
resets the baud rate for tty09 to 9600. The command
cj> stty -a < /dev/tty09
displays all settings for tty09. On some systems you have to use output redirection (>) instead of input redirection (<) to access a tty other than yours.
In this activity you use the stty command to display the current settings of your tty device driver. Then change options to show how the stty command can affect how your terminal communicates to the UNIX system. Begin at the shell prompt.
cj> stty speed 9600 baud; -parity hupcl susp = ^Z; dsup = ^Y erase = #; kill = @; swtch = ^@; icrnl onlcr tab3 echo -echoe echok
cj> stty speed 9600 baud; -parity hupcl susp = ^Z; dsup = ^Y erase = ^H; kill = ^U; swtch = ^@; icrnl onlcr tab3 echo -echoe echok
|Previous||Table of Contents||Next|