So, there are some tricky bits to serial communications that I feel it would be good to share.
First oddity: The computer sends a CR character (decimal 13) when the user pushes Enter, but the ATmega must send a CR(13) and an LF(10) character to move the cursor to the beginning of the next line.
Second oddity: Backspace does not delete the character. It will only move the cursor back one. So, to erase a character, you must send a backspace character (decimal 127), then a space(32) to clear the old character, and then a backspace to move the cursor back again.
That's it for simple stuff. Now for escape sequences! ANSI escape sequences are mystical combinations of characters that carry special meaning. Generally, they all start with the ascii ESC character (decimal 27), followed by the left square bracket (decimal 91). After this sequence of characters, which is called the Control Sequence Introducer, you will find any number of other characters that indicate which control sequence it is. It's so much fun, I can hear you scream with joy already.
Here are a list of examples of commands that the ATmega can send to the terminal, all of which begin with ESC [
Of course, the terminal doesn't like being bossed around, so it often talks back to the ATmega, with the following commands that also start with ESC [. They usually come from special keys that have been pushed, but they don't do anything until the ATmega gives the commands to actually move the cursor.
Other input notes:
Additional information about ANSI: Wikipedia