zsh home and end keys problem

I had a long time problem. One of these that we cannot solve googling for information.

My banana pi shell, the zsh dont handle the home and end keys.

For some time, more than an year, I miss that keys functions.

Start digging again I notice that the following this procedure:

In order to see the sequence to give to bindkey for the key you want, use quoted-insert (control-V) and press the key combination.
So, in order to get bind something to your keyboard’s delete key, you do:

bindkey ‘<ctrl-v><delete>’ delete-char

So I done that for both keys,  and add it at the end of ~/.zshrc

bindkey -s "^[[1~" beginning-of-line
bindkey -s "^[[4~" end-of-line

But instead of going to end-of-line or to the beginning-of-line, it echo it on the command line.

Then in despair I run:

bindkey

That gives a long list starting with:

“^@” set-mark-command
“^A” beginning-of-line
“^B” backward-char
“^D” delete-char-or-list
“^E” end-of-line

Then i just replace the strings with the correspondent codes as bellow:

bindkey -s "^[[1~" "^A"
bindkey -s "^[[4~" "^E"

And it works.

Home key send cursor to the beginning-of-line.
End key send the cursor to the end-of-line.