delete character

{{Short description|ASCII character number 127}}

The delete control character (also called DEL or rubout) is the last character in the ASCII repertoire, with the code 127.{{cite ietf |title=ASCII format for Network Interchange |rfc=20 |author=Vint Cerf |date=October 16, 1969 |publisher=IETF}} It is supposed to do nothing and was designed to erase incorrect characters on paper tape. It is denoted as {{tt|^?}} in caret notation and is {{tt|U+007F}} in Unicode.

Terminal emulators may produce DEL when {{keypress|Backspace}} key or {{keypress|Control|Backspace}} or {{keypress|Control|?}} are typed.

History

align=right width="16em" style="margin-left:1em; margin-bottom:1ex"

| bgcolor=black rowspan=5 | 

|

· 

| bgcolor=black rowspan=5 | 

|NUL

·CR
·LF
bgcolor="#FFFF99"

|

·DEL
·SP
colspan=12 style="font-size:small" |"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 1s by punching holes everywhere. If a character was punched erroneously, punching out all seven bits caused this position to be ignored or deleted.{{cite book|author=Robert C. Martin|title=The Clean Coder: A Code of Conduct for Professional Programmers|url=https://books.google.com/books?id=ik0qCTVzl44C&q=rubout+punched+tape&pg=PA202|publisher=Pearson Education|isbn=9780132542883|year=2011}}{{cite web|author=LaFarr|title="Paper Tape" First Machinable I/O|url=http://www.zyvra.org/lafarr/papert.htm|date=18 August 2006}} In hexadecimal, this is 7F to rub out 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 {{keypress|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 (BS). 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 in products from Digital Equipment Corporation. On VT100 compatible terminals, this is the character generated by the key labeled {{keypress|Delete}}.{{cite web|title=VT100 Family of Video Terminals|url=http://www.vt100.net/docs/tp83/chapter5.html|publisher=vt100.net}}{{cite web|title=VT100 User Guide- Chapter 3 – Table 3-4 Function Key Codes|url=http://www.vt100.net/docs/vt100-ug/table3-4.html|publisher=vt100.net|access-date=2015-04-12|archive-date=2016-03-14|archive-url=https://web.archive.org/web/20160314113114/http://vt100.net/docs/vt100-ug/table3-4.html|url-status=dead}} On later terminals, such as the VT510, the key is labeled {{keypress|⌫}} (called backarrow in the manual{{cite web|title=VT510 Video Terminal Programmer Information – Chapter 5 – ANSI Control Functions|url=http://vt100.net/docs/vt510-rm/DECBKM.html|publisher=vt100.net}}) and by default sent DEL, but could be set up to send BS.

Other terminals designed for systems that did not have a history of using Teletypes would usually make a key at this position send BS, leading to much confusion. Unix, in particular, had a problem in 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 brand of terminal. Depending on the type of terminal the designer used, software would sometimes make the shortcuts {{keypress|Ctrl|H}} or {{keypress|Ctrl|?}} do something, even though these sent the same code as BS and DEL, assuming the backspace key was sending the other code.

A key marked {{keypress|Backspace ←}} that sends BS is by far the most common on modern terminals and emulators. To ensure text is not deleted backwards, the key marked "Delete" on many terminals does not send DEL and instead sends an escape sequence such as ^[[3~.{{cite web|title=VT510 Video Terminal Programmer Information – Chapter 8 – Keyboard Processing|url=http://www.vt100.net/docs/vt510-rm/chapter8|publisher=vt100.net|access-date=2015-04-12|archive-url=https://web.archive.org/web/20160304024035/http://www.vt100.net/docs/vt510-rm/chapter8|archive-date=2016-03-04|url-status=dead}}

Current use

Unix-like operating systems can still use it as the stty 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. Most Unix terminal emulators can be configured to send either delete or backspace when the backspace key is pressed.{{Citation needed|date=November 2023}}

DOS/Windows never used this character in any way. The BIOS keyboard driver produced backspace when the backspace key was typed and NUL with scan code 0x53 when the delete key was typed.{{Cite web|url=https://sites.google.com/site/pcdosretro/scancodes|title=Keyboard scan code/Character code combinations - PC DOS Retro|access-date=2020-04-19|archive-date=2020-05-01|archive-url=https://web.archive.org/web/20200501054450/https://sites.google.com/site/pcdosretro/scancodes|url-status=dead}} In Windows, the delete key maps to VK_DELETE (0x2E).{{Cite web|url=https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes|title = Virtual-Key Codes (Winuser.h) - Win32 apps| date=22 June 2022 }} 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 parts of the Windows operating system: as an example, {{keypress|Control|Backspace}} in Microsoft Notepad used to insert the delete character{{Cite web|url=https://superuser.com/a/332034/1175193|title = Shortcuts - Notepad CTRL-Backspace behavior}} until it was changed in 2018 to make it delete the previous word.{{Cite web|url=https://makeuseof.com/tag/new-improved-windows-10-notepad|title=The New and Improved Windows 10 Notepad: Useful Tips and Features|date=23 November 2018}}

See also

References