Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make iterm2 send Control-H for backspace so it works for all Linux shells

Tags:

vim

macos

ssh

iterm

I had some problems with Terminal.app in OSX when my backspace key didn't have backspace behaviour. Basically, pressing backspace caused a delete instead. In Terminal you can fix this by going to Preferences/Settings/Advanced and ticking 'Delete sends Control-H' which works on all the servers that I SSH into.

I have now shifted to iTerm2 How do I do the same thing on iTerm2?

Many thanks.

like image 928
ale Avatar asked Oct 22 '12 18:10

ale


People also ask

How do I fix the backspace key in Linux?

Linux and XFree86 come configured with both the Backspace and Delete keys generating Delete. You can fix this by using any one of the xmodmap, xkeycaps, or loadkeys programs to make the key in question generate the BackSpace keysym instead of Delete.

Why my Backspace is not working in Linux terminal?

Checking Terminal Settings with stty The -a flag will give a human-readable output of the control characters. Look for the "erase" character. If it says "^H," then it uses the older Backspace character. Fortunately, you can also fix this with the stty command.

Which control character is used as Backspace in Linux?

The key combination for the ASCII backspace control character is ^H (hold down Ctrl and press H . However, pressing this combination on the shell command line simply performs the "backspace" operation.


1 Answers

Ok, fixed already sorry! For anyone else who needs this:

iTerm2 -> Preferences -> Keys -> Key Mappings -> click on the + symbol  
-> Click to Set -> press backspace -> select 'Send ^H Backspace'
like image 181
ale Avatar answered Sep 28 '22 08:09

ale