The terminal erase control codes are used to fill an area of the screen with blank characters in the default (reset) background color. The erase commands work by screen, row, and character.
For more information about the general syntax of the PropTerm ANSI control sequences see the ANSI Protocol page
The symbol "CSI" will be used to indicate that either a seven bit or eight bit ANSI start sequence may be used.
The "n"symbol indicates a numeric parameter which is sent to the terminal as an ASCI decimal string.
Erase Control Sequences:
Erase Screen: CSI 2J
The erase screen command erases the entire screen then places the cursor at the home (1,1) position.
Erase From Screen Start: CSI 1J
The erase from screen start command erases the screen from the home position to the current cursor position inclusive. The cursor position remains the same after the command completes.
Erase To Screen End: CSI J or CSI 0J
The erase the screen to end command erases the screen from the current cursor position to the last screen position inclusive. The cursor position remains the same after the command completes.
Erase Row: CSI 2K
The current cursor row is erased. The cursor position remains the same after the command completes.
Erase From Row Start: CSI 1K
The erase from row start command erases the current cursor row from the first column on the row to the current cursor column inclusive. The cursor position remains the same after the command completes.
Erase To Row End: CSI K or CSI 0K
The erase to row end command erases the current cursor row from the current cursor column to the end of the row inclusive. The cursor position remains the same after the command completes.
Erase Characters: CSI n X
The erase characters command erases "n" characters starting from the current cursor row and column. If the current column plus "n" is greater then the number of screen columns the last character erased will be the end of the current row. If the parameter "n" is missing a value of one is assumed. The cursor position remains the same after the command completes.