Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use urxvt in combination with zsh. However since my fresh install of ubuntu 10.04 I have the following problem. If I type backspace the cursor moves to the right (instead of deleting the characters on the left).

Suppose I typed n characters then pressing backspace n-times moves the cursor n- positions to the left, if I type backspace then one more, the cursor doesn't move anymore.

If I type the left arrow, nothing happens, if I type the right arrow afterwards a some character occurs.

mv .zshrc .zshrc.bak
mv .Xdefaults .Xdefaults.bak

didn't help.

urxvt + bash works fine as well as xterm + zsh.

zsh-version: 4.3.11-4ubuntu2.is.3ubuntu1 rxvt-unicode version: 9.09-3

Any idea how to fix this?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

Try adding the following to your .zshrc:

TERM=xterm
share|improve this answer
    
This fixed it for me FWIW. –  seth Jul 26 '11 at 22:22
    
Thanks for the workaround! It fixed it for me, too! –  student Jul 27 '11 at 14:36

You could also get around the problem by setting

stty erase '^?'

Here are some details about the deviant behavior of certain terminal emulators (which is by the way why certain emulators have this problem): Linux Backspace/Delete mini-HOWTO.

share|improve this answer

In zsh, what does bindkey | grep delete say? These are the lines I get:

"^D" delete-char-or-list
"^H" backward-delete-char
"^[3;5~" delete-char
"^[[3~" delete-char
"^?" backward-delete-char

You should have "^?" as that represents backspace. If not... you can call bindkey "^?" backward-delete-char at the zsh prompt to put it in.

Does that resolve the problem?

share|improve this answer
    
bindkey | grep delete "^D" delete-char-or-list "^?" backward-delete-char –  student Jul 23 '11 at 18:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.