Clear display on serial monitor

Given ESC-H/ESC-J is "home/clear screen" from VT100 days:

void setup() {
  Serial.begin(9600);
  Serial.print("\n"); // CRLF
  Serial.print("\h"); // HOME
  Serial.print("\j"); // CLRSCR
}
void loop() {}

The IDE protests the unknown (unsupported) escape sequences.

C:\...\sketch_mar12a.ino:4:16: warning: unknown escape sequence: '\h'
   Serial.print("\h");
                ^~~~
C:\...\sketch_mar12a.ino:5:16: warning: unknown escape sequence: '\j'
   Serial.print("\j");
                ^~~~
1 Like