Fixing Delete and Backspace in OS X Terminal
I’m constantly having trouble with getting the backspace and delete keys to work properly in OS X. Whenever it works right on the Mac, one or the other key is broken when I Â SSH to a Linux or FreeBSD box.
After some searching, I’ve found this solution, which seems to be working:
- First, got to the Terminal menu, and choose Preferences…Â Under the SettingsÂ section, choose the AdvancedÂ tab. Make sure Delete sends Ctrl-HÂ is checked.
- Then, in the same window, go to the Keyboard tab (right next to Advanced). Find the line for forward delete, and set it to this value:
- Lastly, you need to run the following line at the terminal. The trick with the line below though is that you need to type the ^H byÂ pressing Control-V and then Control-H. You can notÂ just cut and paste the line below, you need to type it:
echo -e "stty erase Ë†H" >> ~/.bash_profile
Now you can restart Terminal, and your backspace and delete should work correctly everywhere!
For further reading on this topic check out these two links:
This problem, and various solutions are documented all over the net, but I found and used this page most recently.