2

I have a clean installation of openSuse. This automatically sets up bash as the default shell.

For historic reasons, all of the aliases and shortcuts I want to port from an old computer are in tcsh, and I don't really feel up to learning how to do the same in bash. Instead, I changed the login shell to tcsh, and I'm happy.

The problem I have now is that backspace only deletes forward (like the del key), instead of backward (like ctrl+h). How can I bind the backspace key to delete backwards instead of forward?

2 Answers 2

2

The shell command to change key bindings is bindkey, Backspace presumably sends byte 127 (^?; check by typing Ctrl+V then Backspace), and the edition command to delete a character backwards is backward-delete-char. So put this in your ~/.tcshrc:

bindkey '^?' backward-delete-char
0
# stty erase <press backspace key>
2
  • This doesn't actually work. Commented Mar 28, 2012 at 22:06
  • This might work dependent on terminal and previous configuration. I have used stty erase '0x7f' in the past as a fix. Entering the key '^?' with Ctrl + V then Backspace could also work. Simply pressing backspace might not work as intended as it can output other characters to the command-line.
    – HKOB
    Commented Mar 10, 2022 at 17:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .