aboutsummaryrefslogtreecommitdiffstats
path: root/usr/clear.c
blob: 76ee4dc8164a3a1cf388a92c4a08afc3f76db266 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#include "gbos.h"
/* clear: erase the screen and home the cursor.
 * Emits ESC[2J, which the terminal understands (see term.asm term_erase_all) -
 * printing 18 newlines would only scroll the history up, not clear it. */
void main(void) {
    putc(27);
    putc('[');
    putc('2');
    putc('J');
}