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.

16 Responses to “Fixing backspace in screen in Terminal on OS X”

  1. Tweaking Terminal - Macified Says:

    [...] 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! [...]

  2. ted Says:

    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.

  3. domi235 Says:

    Thanx for the tip! You we’re my saviour !

  4. Albert Peschar Says:

    Works great! Thank you!

  5. arne Says:

    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.

  6. Matt Says:

    Cool, export TERM=xterm works for me, OSX, using terminal.app sshing to a remote server and running screen there.

  7. Mikko Ohtamaa Says:

    This is just wonderful! I tried tons of different terminal applications and none of them worked out of the box.

  8. Gui Says:

    Damned, it works :)
    i think to change many thinks…but not this TERM environnment variable !

  9. Gui Says:

    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, …)

  10. designdream Says:

    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

  11. Ian Says:

    @desgindream Yeah, this was added in Leopard. In Tiger, changing $TERM was the only way to make it work.

  12. Troy Says:

    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

  13. backspace problem with screen in remote debian with os x « 0xcb0’s Blog Says:

    [...] 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 [...]

  14. Hamlesh Motah Says:

    export TERM=xterm

    that worked a treat :) Now I can stop getting annoyed when using irssi :)

  15. Ben Says:

    As others have said, export TERM=xterm fixes things. Put it in ~/.bash_profile to add it permanently.

  16. Chris Says:

    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!

Leave a Reply