1

Every 5 to 20 minutes I need to retype

stty erase ^H

in the console because my backspace key randomly starts printing ^H instead of deleting characters. This is happening in git bash on a lenovo T410

Any help would be appreciated this is pretty annoying

vicg
  • 61
  • 5
  • Have you tried? "stty erase ^H backspace" already? – Ben Sampica Jun 12 '15 at 18:20
  • that didn't work, as in it threw an error. When I say I type 'stty erase ^H' I mean I actually hit backspace to generate that '^H' value because all backspace does is print that – vicg Jun 12 '15 at 18:50
  • Presumably some program which OP is running changes the stty erase value. – Thomas Dickey Jun 12 '15 at 20:31
  • Duplicate of [Bash, how to globally fix ^H and ^? backspace problems](http://superuser.com/questions/641095/bash-how-to-globally-fix-h-and-backspace-problems) ? – harrymc Jun 15 '15 at 19:46

3 Answers3

1

Add the following line to your ~/.inputrc file (and restart the terminal of course):

"\e[3~": delete-char
Steven
  • 27,531
  • 11
  • 97
  • 118
0

Adding this line to .bash_profile (or running it from within the terminal) solved the issue for me without needing to change any other parameters:

export TERM=xterm
assylias
  • 416
  • 1
  • 3
  • 14
0

Some console utilities don't interpret the backspace character (^H) as a backspace and need a delete instead.

In this case, enabling the option 'Backspace sends delete' in the 'Mapped Keys' sub-category under 'Emulation' and 'Terminal' in the 'Session Options' should allow for the 'Backspace' key to function correctly without affecting how the command shell works.