I'm trying to use Code:stty erase "^?" to change the behavior of the delete key. Both Backspace and Del are working as backspace, and I find this quite annoying. But, after executing stty as written above, I just get a backspace command that prints "^H" instead that "^h", and a del key that acts as backspace. If I use csh instead of bash, simply nothing happens. What can I do?
It may also depend on your terminal. For instance, xfce's Terminal has Edit/Preferences/Advanced "Backspace generates" options. Otherwise, Consistent BackSpace and Delete Configuration is useful.
stty doesn't work. Either bind. If I try to set something, the only thing I succeed in is corrupting backspace.
Firstly, if you currently have multiple keys working as backspace, what makes you think setting another (or resetting one of the existing keys) will stop one or other from being backspace? Maybe it will, I dont have mutiple keys working as backspace to test against but not convinced. Secondly, are you using the carrot key "^" when you enter the stty erase command? This needs to be entered not using the carrot key as you find it on they keyboard, but simply by pressing the backspace or whichever key you want. You may have to first type Ctrl+v then type the key you are after, Ctrl+v escapes special keys. IE on one of my systems backspace is "^?", which is written in a terminal window if I first type Ctrl+v then backspace... thanks Andy.
Remove the quotes. # stty erase ^? Instead of typing shift-6 (on a US keyboard) and ? press the backspace key. Works as it should. But you should not need to change it. It's set correctly by default. Same for home and end keys.
I've already done it, it just do nothing! When I press backspace I expect that the character on the left of the cursor will be deleted, and the right one when I press Del. In both cases, the left char is the one to be deleted, even if I try to set other values for erase or erase2, the only results I managed to get are a corrupted backspace key and a delete key that works as before. I don't know why, nobody of you have ever get this behavior before?
The delete key doesn't do what you expect it to do. In traditional unix the delete key acted as backspace (backspace didn't exist). Learn to use ctrl-d.