Enable backspace when ssh into a debian machine with zsh 2

Posted by Antonin AMAND Tue, 30 Oct 2007 12:16:00 GMT

As many users of mac OS X, I’ve encountered some troubles with the backspace key when ssh into a debian machine.

Reading some posts on the web, I was thinking that the problem was about the shell or the tty. But in fact it was related to zsh.

The default zsh map on debian is not correct for mac users. The solution is to tell zsh how to bind keys.

echo "bindkey ^? backward-delete-char" >> ~/.zshrc
echo "bindkey ^[[3~ delete-char" >> ~/.zshrc

Use ctrl+v [key] to generate the ^... characters.

Comments

Leave a comment

  1. Brian Donovan about 1 month later:

    Instead of doing ctrl+v [key] I found it easier to just surround it with single quotes, yielding:

    echo "bindkey '^?' backward-delete-char" >> ~/.zshrc echo "bindkey '^[[3~' delete-char" >> ~/.zshrc

    Thanks a bunch, this was really frustrating me.

  2. Matt Foster 7 months later:

    Thanks for the post.

    I'd suggest you have a gander at zkbd. It'll automatically do things like this, once you get it set up.

Comments