Why does fn-⇧-→ (or others) do a home/end in Terminal but a ⌘-→ works everywhere else?
So just to be clear the question is how to make Terminal take Command + ← and → for home and end?
As convenient as it would be, Terminal can't easily provide the functionality you ask for.
The reason is that other programs run inside Terminal, like
Other programs may use other keys. There isn't any universal key combination for positioning the cursor at the beginning/end of the line.
Of course, Terminal could maintain a list of key combinations for a number of common programs, check what's running and send the correct keys for you, or it could provide a menu item like Move Cursor To Beginning Of Line Inside Shell ⌘← and then send CtrlA behind the scenes. But I guess Apple engineers thought that if you venture in CLI territory you know its idiosyncrasies.
(Surprinsingly, Terminal provides Option← and Option→ which behaves as you would expect, moving the cursor to the beginning of the previous/next word. That only works reliably in
The closest you can get to the standard key combinations ⌘← and ⌘→ is shift← and shift→. Go to Preferences...>Settings>[your active profile]>Keyboard:
press +, select "cursor left", "shift" as modifier and action "send string to shell". Then press CtrlA (
Now add a key combination for "cursor right" and press CtrlE. From now on you can use shift← and shift→ as a poor man's ⌘← and ⌘→ (notice that it will only work for programs that honor CtrlA/CtrlE).
I'd recommend, though, that you learn the specific key combinations of each program you use in Terminal.