I switched to Catalina and enabled ZSH now my home/end key do not work in terminal
The other answers didn't work for me when connecting over SSH to the Mac. I had to add the following lines to my ~/.zshrc to get Home and End to work:
bindkey &quot;^[[H&quot; beginning-of-line
bindkey &quot;^[[F&quot; end-of-line