On Sun 2009-03-15 12:39:33 UTC-0400, Brett McCoy ([email protected]) wrote:
> > I tried to clear the screen ?with something like
> > printf("\x1B[2J"); but I ?couldn't get it to work.
>
> This worked for me under gcc (CygWin) in the CygWin bash shell
>
> $ cat clrscr.c
> #include <stdio.h>
>
> int main() {
>
> printf("\x1B[2J");
> return 0;
> }
>
> Haven't tried it under VC++ under the cmd shell but this kind of thing
> used to work under DOS if you had ANSI.SYS loaded.
These are ANSI escape codes (or escape sequences). See the Wikipedia
article for more information - including an explanation of how to get
them to work under Windows NT's command shell:
http://en.wikipedia.org/wiki/ANSI_escape_code