Friday, May 18, 2007

So you are a screen user


So you are a screen user on linux but your workstation is a Mac. You probably run into the backspace problem constantly. Specifically you ssh to your Linux box, the backspace works, but once you attach to screen now you get all sorts of problems. One solution is to

stty erase ^?
but backspace doesn't work for screen commands.



The real problem is there is a mismatch between OS X terminal and the TERM string it sets for itself. There are two solutions. Solution #1 is to do this when you login:
export TERM=xterm
The other solution is to do these commands on your Linux box:


cd ~
mkdir -p .terminfo/x
cd .terminfo/x
wget http://invasioncity.com/~ryan/xterm-color


The problem is the xterm-color by default on Linux mismatches backspace codes with what Terminal does on OS X. You might think that using the "delete key sends backspace" option in Terminal window settings might do the trick, but sadly no.

3 comments:

cow boy said...

re: http://invasioncity.com/~ryan/xterm-color

"permission denieid"

perhaps you could chmod accordingly?

Anonymous said...

As of the current version of Terminal you can go into the settings->advanced window and check the "delete sends ctrl-h" box.

Fixed!

Aaron said...

the ctrl-h option has been changed to window settings -> keyboard (tab), checking "Delete key sends backspace", the issue I have with this is that it makes it so my backspace key is a delete key in vim, thus I went with the fix #2.