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