Apple terminal no home and end key - Use cmd left or cmd right
You can use Better Touch Tool for this (it's no longer free, 5$ minimum), just assign keyboard shortcuts  to work in Terminal app only. Remap ⌘ CMD+← to ⌃ CTRL+A and ⌘ CMD+→ to ⌃ CTRL+E. Here's the sample: