San Diego State University

Technical Briefs

ROHAN help Files

----------------------------------------------------------------------

stty

The stty command sets the various options for the terminal, such as which key to use to erase a line or a character, or which key kills a file. These commands can either be typed in on the command line (in which case they would only be active during the current session), or they can be added to the user's personal .login file and would be the settings every time they login. To check and see how the terminal is set up, at the ROHAN prompt type:

rohan% stty all

A list of the current settings will display on the screen. The last two lines show the keyboard codes and the keys to which they correspond. All these settings are changeable and can be modified to suit the users specific needs. To use stty to change a key assignment, give it the name of the special character to change and the character that is to be used. To use a control character, type a caret (^) followed by another character, both enclosed in quotation marks. For example, to make the Delete key (represented by ^?) the erase key, at the ROHAN prompt type:

rohan% stty erase '^?'

This will change the erase key from it's previous setting to the Delete key. For the rest of the current session, when the Delete key is hit, it will remove one character at a time from the command line.

To permanently change the settings, it is necessary to change the .login file to reflect the new information. At the ROHAN prompt type:

rohan% vi .login

This will bring the .login file up in the vi editor. The .login files on ROHAN are organized into groups of commands to make the file easier to understand. The most logical place to add stty commands is at the end of the first group of set commands. Position the curser at the end of this group and type:

O

This is a capital O and will open a new line in append mode. Type the following to change the Delete Key to the erase key:

stty erase '^?'

Write and Quit the file. The next time the user logs into ROHAN, the Delete key will be automatically set to remove one character at a time from the command line.

----------------------------------------------------------------------


BACK ROHAN Help Index | Academic Computing Handouts, Manuals, and Help Files