Goal: To move the shell cursor around quicker.
Problem: Cannot enter escape character sequences in terminal inspector
You can add some convenience functions to your shell via a file called .inputrc in your home directory. For example, the line:
"e[5C": forward-wordwill move the cursor to the next whitespace when the character sequence "Escape-[-5-C" is sent to readline by the Terminal (note that ESCAPE is, in fact, a non-printable ASCII character).
However, there is a problem in terminal.app: how can you define custom Escape character sequences? For simple, non-Escape character sequences, all you have to do is open Terminal.app's Inspector and push the Add button in the Keyboard view. Set key to cursor right, modifier to control and action to send string to shell. In the textfield, just enter the desired character sequence.
The problem with Escape sequences is that there apparently is no way to enter the Escape non-printable character in this text field. The inspector says to "Hold the option key and press esc or ctrl to create a string containing those special characters." However, pressing Option-Escape does nothing at all, and pressing Option-Escape-[ only generates the unicode character """, like in all Cocoa applications.
So to enter the desired escape character sequence (ESCAPE-[-5-C in this example), you can do the following. In the shell, enter:
echo -ne "e[5C"|pbcopyThis will put the correct escape character sequence in the pasteboard. Just switch to the Inspector again, and paste the pasteboard's content into the textfield. The non-printable escape character will not be visible in the textfield, but will get sent to the shell when the key combination it was bound to is pressed.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040111081916984