Home and end keys not working as expected

From here. Insert/uncomment this

"\e[1~": beginning-of-line
"\e[4~": end-of-line

in the /etc/inputrc file