Escape codes can be used to position the cursor. This is commonly used to provide a clock or some other kind of information at a different location on the screen, such as an upper corner, each time the prompt is drawn. Table 13-4 lists the escape codes that position the cursor.
Table 13-4. Cursor Movement Escape Sequences
Move the cursor to line
Move the cursor up
Move the cursor down
Move the cursor forward
Move the cursor backward
Clear the screen and move the cursor to the upper-left corner (line 0, column 0).
Clear from the cursor position to the end of the current line.
Store the current cursor position. ...