ESC 0x1b
- Introduces an escape sequenceCSI 0x1B [
- Control sequence introducerOSC 0x1B ]
- Operating system command
VT sequence | Description | Example |
---|---|---|
CSI row ; col H |
Position the cursor | CSI 1 ; 1 H |
CSI color m |
Set graphics rendition | CSI 41 m |
CSI 2 J |
clear the whole screen | |
CSI 3 J |
clear scrollback buffer (history) |
color code | name |
---|---|
30 | foreground black |
31 | foreground red |
32 | foreground green |
33 | foreground yellow |
34 | foreground blue |
35 | foreground magenta |
36 | foreground cyan |
37 | foreground white |
40 | background black |
41 | background red |
42 | background green |
43 | background yellow |
44 | background blue |
45 | background magenta |
46 | background cyan |
47 | background white |
#include <stdio.h>
int main()
{
printf("\033[1;1H\033[2J\033[3J"); // will do merely the same like your /usr/bin/clear command
return 0;
}