Cygwin and ZSH - Delete, Home and End keys
Under certain configurations, the Home, End and Delete keys will insert arbitrary characters
(in most cases, the tilde symbol) when using the popular ZSH under Cygwin. The issue is caused by a
wrong or missing keyboard configuration and easy to fix by adding a few lines to the
# ctrl-left and ctrl-right bindkey "\e[1;5D" backward-word bindkey "\e[1;5C" forward-word # ctrl-bs and ctrl-del bindkey "\e[3;5~" kill-word bindkey "\C-_" backward-kill-word # del, home and end bindkey "\e[3~" delete-char bindkey "\e[H" beginning-of-line bindkey "\e[F" end-of-line # alt-bs bindkey "\e\d" undo
The above section will add keyboard shortcuts for traversing through words as well as fix the
End keys. It will also fix the backspace and delete key behavior by adding properly
configured sequences for deleting the next and previous words.