Erase Characters and other Keyboard Mappings

One point of confusion that often occurs involves the mapping of the delete or backspace key to properly erase characters.

To identify your current settings, type:

stty -a

Then look for ‘erase =’. Common settings include ^h, ^?, or del. (del and ^? have the same function). Most applications use the current settings to perform line editing functions, such as erase. Some applications have a default definition for ^h and ^?. The following table describes these conventions.

application           ^h           ^? or del
tcsh              erase     erase
emacs             help      erase
Xwindow-based     generally set by the application
vi                erase is defined in current settings
mail              erase is defined in current settings
others            erase is defined in current settings

To identify how a key is mapped on your keyboard, you can type: ‘ctrl-v’ followed by any key. Its mapping is echoed to your display. To identify the locations of ^h on your keyboard, check out the following

To change the current setting of the erase character, type: stty erase ctrl-v KEY where KEY is the key that you want to use to erase characters.

Department of Electrical and Computer Engineering :: University of California Davis :: One Shields Avenue :: Davis, CA 9561

Comments are closed.