Ok I'm stupid.
I have DoubleCommand installed, and I, for some reason, enabled the "shift+delete acts as forward delete" command. Apologies.
The answer to the question to which you linked shows how to find the control sequence Terminal sends when you press FnBackspace: echo '
ControlV FnBackspace' | od -c
.
The ControlV is critical to prevent special interpretation of the (likely) initial ESC character.
Terminal probably sends the four byte sequence ESC [ 3 ~
.
The question to which you linked was asking about zsh. The comment on the answer gives the command to bind the sequence in zsh, i.e:
bindkey "^[[3~" delete-char
(usually in ~/.zhsrc
).
However, bash is the default shell on Mac OS X, so the command to bind a key (and the functions available for binding) will be different if you are using bash: bind '"\e[3~": delete-char'
. You will probably want to put this in a bash startup file1.
If you find that you are using bash, but you want to use zsh instead, then there are two ways to change your effective shell:
- Use
chsh -s /bin/zsh
to change your default shell.
This will change the shell that Terminal starts as well as the shell started for other login sessions (e.g. logins through SSH).
- Configure just Terminal to use a different shell in Terminal’s preferences.
Terminal > Preferences…, Settings tool bar button, then the Shell tab,
change Run Command to (e.g.) /bin/zsh -l
.
1 Usually ~/.bashrc
, but you can also put a related line ("\e[3~": delete-char
) in ~/.inputrc
instead. If you put it your .bashrc
, you will want to make sure that you also have a line like source ~/.bashrc
in ~/.bash_profile
, or ~/.bash_login
(if you have neither, then create the former; if you already have exactly one of them, then use the one you have; if you have both, then you should fix that since probably only the former is being used).
Best Answer
A Forward Delete on a Mac is not the Backspace on Windows, but is the Delete on a Windows keyboard. The Backspace on a Windows keyboard is called Delete on a Mac.
On a Mac, the Delete key is labeled "
delete
" or shows some left arrow (and ⌫ in the menus). The Forward Delete is labeled "⌦" or "del
" (not "delete
"), or "delete
⌦". If no such key is present, one can hold down Fn while pressing Delete.Not seeing the funny characters? See the note on using "Arial Unicode MS" at Get Dingbats to appear in Firefox 3?
While we're at the topic of keyboards: Macs don't use Alt, but use Option. Up till recently, the Option key was labeled with the funny ⌥, representing the pull-out plastic card situated under the Lisa keyboard. The latest keyboards no longer show that symbol, but only "option", while ⌥ is still shown in menu shortcuts. Likewise, Control has always been shown in the menus as ⌃ (up arrowhead, not Shift-6 which yields ^, being the circumflex), but was never shown on the keyboard using that symbol either. Makes one wonder why the Command key is still also labeled ⌘ on today's keyboards...
The Option key on Mac keyboards is also labeled "alt", just in case you're controlling some Windows or Linux machine, either remotely, or by booting your Intel machine into another operating system. So, a Mac never uses Alt, but always uses Option. They just happen to be the same key. See also Apple's Switch 101: On Windows, I used to...