Much of the stuff you describe is determined by two things, which work together:
1) the $TERM environment variable, which is set by the terminal program when it starts.
2) the /etc/inputrc file, which contains readline bindings/translations for those 'gibberish' keycodes you see.
You can create your own ~/.inputrc file, and use the
$include directive to include the system one located at /etc/inputrc. This can allow you to customize actions for those 'gibberish' characters. NOTE: The actual shell you are using (Bash, Dash, Ash, whatever) must also be capable of understanding and dealing with the codes you configure (specifically something like "history" which AFAIK only works for Bash; the usual stuff, like going to the end of a line, or skipping words, should work for most modern terminal programs), but as yet, I have not encountered a keycode that doesn't work properly after having configured it in my ~/.inputrc file.
The procedure:
1) open the terminal that gives you gibberish upon certain keystrokes;
2) press CTRL-V
3) Now, press the key stroke that you wish to configure.
4) Note the gibberish.
5) open your /etc/inputrc or ~/.inputrc file and add an entry for the gibberish (use etc/inputrc as a template of examples)
6) Now that keycode will work properly in that terminal.
Hope this helps
but if there's stuff I left out (and there probably is a lot more to this) just ask, or explain what's not working.
Sasha
PS - after having saved you new items in the inputrc file, you may have to reboot, logout, or source the /etc/profile file, for the settings to take effect sooner than later. The inputrc file and its environment variable are set during bootup, by an entry in /etc/profile (at least on my Slackware system -- it *might* vary for other Linuxes.)