Hello all, sorry to revive such an old post, but I got this very same issue working under urxvt terminal emulator (aka rxvt-unicode) and went down the rabbit hole digging for this in the source code of Elixir and later Erlang shells, and I found Home/End keys are working for Erlang shell erl since Oct 2015, and so they are working under Elixir shell iex too.
Tested several terminals and on mostly all of them both the Home and End keys work fine.
This is the list of terminals that have working Home and End keys:
Since many people use urxvt I wanted to post this, because I went down several hours hunting for a fixing in the source code, when in fact this is already implemented and is not an issue.
Finally, I’ve tried configuring my ~/.Xresources file for urxvt but didn’t have luck, tried: