Windows – Cygwin + zsh: Home and End keys not working

cygwin;minttywindowszsh

I cannot get Home and End keys to work for zsh under Cygwin. Various sources seem to suggest that

bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line

will fix the problem but this does not work for me. Strangely, after I enter

bindkey "\e[3~" delete-char

the Delete button starts working (before that it just outputs ~).

Does anyone has an idea what is going on?

I'm on Windows XP and I am using the latest versions of the available Cygwin packages.

UPDATE: This seems to be a problem with mintty, if I run cygwin.bat that launches the Windows command prompt, then everything works fine. Maybe it is related to this bug?

Best Answer

With the help of the mintty mailing list (https://groups.google.com/forum/?fromgroups#!topic/mintty-discuss/v4b86DBNI80) I found the answer. The lines that I need to add to .zshrc are

bindkey '\e[H' beginning-of-line
bindkey '\e[F' end-of-line 
Related Question