Fixing backspace in screen in Terminal on OS X
Some title, eh? The problem is this: When using screen on a remote host in Terminal on OS X, backspace doesn’t work. Highly irritating. Here’s the solution. In the terminal, run:
defaults write com.apple.Terminal TermCapString xterm
And you’re all set.

May 30th, 2006 at 12:38 pm
[...] The biggest problem turned out to be backspace. It didn’t work at all when using screen on a remote host. Luckily Google pointed me here. The solution was to type a somewhat cryptic command in Terminal - certainly something I didn’t expect OS X to require me to do! [...]
June 26th, 2006 at 1:02 am
I spent way too long looking for a fix for this… I had this same problem on osx but while using “aterm” instead of terminal. This page helped me figure it all out though. If you’re using a terminal other than “Terminal.app,” this is what you do:
export TERM=xterm
You can put that in your .bashrc, .zshrc, or whatever you use.
February 1st, 2007 at 10:40 am
Thanx for the tip! You we’re my saviour !
February 24th, 2007 at 12:23 pm
Works great! Thank you!
April 2nd, 2007 at 7:29 am
I love you. Really. Can’t believe how long I’ve been looking for a solution for this problem + how simple the actual solution is… Thanks.
I will now go and delete heaps of characters.
July 2nd, 2007 at 5:33 am
Cool, export TERM=xterm works for me, OSX, using terminal.app sshing to a remote server and running screen there.
October 12th, 2007 at 12:58 pm
This is just wonderful! I tried tons of different terminal applications and none of them worked out of the box.
August 8th, 2008 at 6:04 pm
Damned, it works :)
i think to change many thinks…but not this TERM environnment variable !
August 9th, 2008 at 11:41 am
Erm, since the modificaiton, see that Backspace produce ^? on such ssh remote shell. After a while, Terminal/Preferences, changing type of terminal to “rxvt” rocks for me perfectly (vi, ssh, screen, …)
November 10th, 2008 at 8:36 am
There is also a checkbox in the advanced terminal.app preferences that will fix this issue. Just enable the checkbox, “Delete sends Ctrl+h”.
This way you can leave you terminal declared as xterm-color.
tata
-flip
November 11th, 2008 at 8:19 pm
@desgindream Yeah, this was added in Leopard. In Tiger, changing $TERM was the only way to make it work.
December 10th, 2008 at 1:34 pm
Nice!
I used the GUI myself: I just changed the terminal to “xterm” in the preferences for each of the Settings group.
Works well now
February 22nd, 2009 at 3:52 am
[...] February 22, 2009 Every time I use terminal in combination with an ssh connection to a remote host and the execute screen I’m not able to use the backspace key. Found a soultion in the comment section of atomized [...]
March 3rd, 2009 at 4:27 am
export TERM=xterm
that worked a treat :) Now I can stop getting annoyed when using irssi :)
March 31st, 2009 at 8:02 pm
As others have said, export TERM=xterm fixes things. Put it in ~/.bash_profile to add it permanently.
June 29th, 2009 at 5:37 pm
I had this exact problem on Mac OSX and the above did _not_ fix it for me. However I found a really simple fix that no-one has mentioned anywhere yet.
Open terminal. Go to the terminal menu in finder -> preferences.
Click on the “Advanced” button on the right then change the pull down box next to “Declare Terminal as” to “ANSI” and close settings. You will need to fully exit and reload terminal for this to take effect.
Viola! Fixed!