Categories
Fixing Delete and Backspace in OS X Terminal - September 25, 2008 by pardsbane

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:

  1. 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.
  2. 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:
    \033[3~
  3. 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.

Are your arrows keys not working in less and vi? - November 5, 2007 by pardsbane

I’ve had this problem sporadically with iTerm on my Mac, and I seem to remember this happening recently on my Linux machines as well. If you have this problem, try this:

$ export TERM=linux

If this works, on a Mac you can set it in your .profile:

if [ "${TERM_PROGRAM}" == "iTerm.app" ]
then
export TERM=linux
fi

On Linux, you can do the same, but leave out the if and just do the export line.

OS X Slow Login and Terminal Startup - October 19, 2006 by pardsbane
A while back my Mac starting taking really long to wake from sleep. I’d get a spinning beachball (SBOD) for 30 seconds before the login screen would appear, and it would take a while for my password to authenticate.

I also noticed that when I started Terminal or iTerm, it took forever. First it took forever for the window to even appear, and then when it did the “last login” line would appear, pause, and then about 30 seconds or more later, the prompt would finally appear and you could use the terminal normally.

I searched the web all over for help on this and did a few maintenance things, but nothing helped. One person online found the solution to their problem by running ‘top’ and watching the login process, but nothing out of the ordinary was happening on my machine.

Then it dawned on me: The exact same thing happens on my Linux machines when the LDAP settings aren’t working correctly, because the LDAP timeout defaults to around 30 seconds.

So I started Directory Access, and sure enough, there was an LDAP server listed under the Authentication tab. I had recently added the same server for the Contacts tab, but I didn’t expect or want to use it for authentication.

Removing the LDAP server cleared up my slow logins and terminal starts, so make sure you check Directory Access if you are having a similar problem.

Post Archive