BACKSPACE cannot delete characters but only shows ^h problems

Source: Internet
Author: User

problem description : In Tclsh, when attempting to delete a character with the backspace key, it does not delete the previous character of the cursor, but instead displays the ^h.
workaround : Type the "Stty erase ^h" command.
Problem Analysis : This problem is not unique to TCLSH, many programs may exist this problem. The root of the TCLSH program is to do line edits, not using the ReadLine library, but relying on the terminal. So we can solve this problem by stty the terminal reconfiguration. When using ReadLine, the terminal is in raw mode, ReadLine itself to explain backspace, delete, arrows and other special characters, when the ReadLine is not used, the terminal is in cooked mode, the terminal driver is responsible for interpreting the special characters.

Transferred from: http://xugaofei.com/testing/117

The Q:backspace key does not delete the character at the left of the cursor, only displays the ^h, and the DEL Key completes the delete operation.

A:sun Microsystems 2001-03-08 Execution "Stty-a" will see "erase = ^?", indicating that the DEL key corresponds to the delete operation at this time.

If you are using xterm, you can use the "tset" command to set the action that corresponds to the control character.

Other windows, assuming currently using/SBIN/SH, try $ stty erase ^h Here ^h the input is ctrl-h, some times may need ctrl-v, ctrl-h input, you can also try $ stty erase "^h" $ stty Erase "^h" ( Case insensitive) Enter "^h" here, which is two characters, one ^, and one H.

Similarly, if you want to revert to del Delete $ stty erase ^? The input to this ^ is del, which may sometimes require ctrl-v, del input, or try $ stty erase "^?" here, which is two characters, one ^, one?

To permanently retain this setting, add the Settings command to the shell initialization file used, such as C Shell's ". CSHRC", and the other Shell's ". Login".

BACKSPACE cannot delete characters but only shows ^h problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.