Delete character

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

In computing, the delete character (sometimes also called rubout) is the last character in the ASCII repertoire, with the code 127 (decimal).[1] Not a graphic character but a control character, it is denoted as ^? in caret notation and has a graphic representation of ␡ in Unicode (as all ASCII control characters have graphic representations).

On modern systems terminal emulators typically turn keys marked "Delete" or "Del" into an escape sequence such as ^[[3~. Terminal emulators may produce DEL when ← Backspace key or Control+← Backspace or Control+? are typed, and some programs such as Notepad may insert this character with the same key presses.

History[edit]

  ·     NUL
· CR
· LF
· DEL
· SP
"Delete" along with some other ASCII control characters and space as they appear on punched tape

This code was originally used to mark deleted characters on punched tape, since any character could be changed to all ones by punching holes everywhere. If a character was punched erroneously, punching out all seven bits caused this position to be ignored or deleted, a computer version of correction fluid.[2][3] In hexadecimal this is 7F to rubout 7 bits (FF to rubout 8 bits was used for 8-bit codes). This character could also be used as padding to slow down printing after newlines though the all-zero NUL was more often used.

The Teletype Model 33 provided a key labelled RUB OUT to punch this character (after the user backed up the tape using another button), and did not provide a key that produced the Backspace character. Therefore, a number of less-expensive computer systems that used Teletypes used this key (and thus the Delete code) to ignore the previous mis-typed character. Video terminals designed to replace the teletype then had to place a key that produced this code where Backspace would be expected, in particular products from Digital Equipment Corporation. On VT100 compatible terminals, this is the character generated by the key labeled Delete.[4][5] On later terminals such as the VT510 the key is labeled (called backarrow in the manual[6]) and by default sent Delete but could be setup to send Backspace.

Other terminals designed for systems that did not have a history of using Teletypes would usually make a key at this position send the ASCII Backspace character, leading to lots of confusion. Unix in particular had an annoying problem that it could only be programmed to erase the previous character for one of these (not both), thus requiring the user to reconfigure the terminal driver for each different brand of terminal. Some software would make the shortcuts Ctrl+H or Ctrl+? do some other action, even though these sent the same code as Backspace and Delete, assuming the backspace key was sending the other code.

A key marked Backspace ← that sends the Backspace character is by far the most common on modern terminals and emulators. Due to the "backspace" key sending Delete on many terminals, keys marked "Delete" typically do not send the character, instead sending an Escape sequence similar to the arrow keys.[7]

Current use[edit]

Unix-like operating systems are known to use it as erase control character, i.e. to delete the previous character in the line mode. The terminal driver still cannot be programmed to take both this and Backspace, one must be chosen, however most modern programs bypass this and use libraries such as readline which accepts both codes.

DOS/Windows never used this character in any way, using the backspace (0x08, or control-H) to delete the previous character. EGA/VGA fonts, as fonts used by Win32 console, usually have the "house" symbol ⌂ at 127 (0x7F) code point, see Code page 437 for details. However, its legacy can be seen in some applications distributed as part of the Windows operating system: as an example, chording the Control and Backspace keys in Microsoft Notepad will output the delete character.

See also[edit]

References[edit]

  1. ^ definition of the rubout character 7F hex
  2. ^ Robert C. Martin (2011). The Clean Coder: A Code of Conduct for Professional Programmers. Pearson Education. ISBN 9780132542883.
  3. ^ LaFarr (18 August 2006). ""Paper Tape" First Machinable I/O".
  4. ^ "VT100 Family of Video Terminals". vt100.net.
  5. ^ "VT100 User Guide- Chapter 3 – Table 3-4 Function Key Codes". vt100.net.
  6. ^ "VT510 Video Terminal Programmer Information – Chapter 5 – ANSI Control Functions". vt100.net.
  7. ^ "VT510 Video Terminal Programmer Information – Chapter 8 – Keyboard Processing". vt100.net. Archived from the original on 2016-03-04. Retrieved 2015-04-12. Cite uses deprecated parameter |dead-url= (help)