Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: rxvt-unicode version: 9.09-3

Any idea how to fix this?

share|improve this question
up vote 11 down vote accepted

Try adding the following to your .zshrc:

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
Better use TERM=xterm-256color to support 256 color. – xuhdev Apr 17 at 22:15

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

It's an old thread and perhaps no-one will see this, but the issue for me was in the .Xresources file. I had misinterpreted the URxvt*termName parameter as the string that would become the urxvt window title. It is in fact what becomes the $TERM environment variable, unless the shell overrides it (bash does).

My solution was to add URxvt*termName: xterm-256color to the ~/.Xresources file. As with any change to this file, you will need to run xrdb -merge ~/.Xresources and completely restart urxvt (including urxvtd daemon processes) for the changes to show.

share|improve this answer

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

Your Answer


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.