From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lokesh Setia To: help-gcc@gnu.org Subject: Re: how to clear screen ?? Date: Wed, 01 Dec 1999 04:06:00 -0000 Message-id: References: <820mu3$qv5v$1@reader3.wxs.nl> <821ded$ro74$1@reader3.wxs.nl> X-SW-Source: 1999-12/msg00003.html >>>>> "Martijn" == Martijn writes: Martijn> Thanx for the reaction.... but what I meant was: How can Martijn> I get my screen cleared from within my c-program?? But you said you wanted to clear the screen while running gcc. What you should have said was "while running my gcc-compiled program", unless you're writing gcc of course :) Anyway, the following should work on most systems: system("clear"); or system("tput clear"); or echo the clear's escape code itself, it's usually portable for commonly used terminals, but not always. Find out the code from: [lokeshs@solaris] ~> tput clear | od -c 0000000 033 [ H 033 [ 2 J 0000007 [lokeshs@solaris] ~> So, you print "Esc [ H Esc [ 2 J", that's "\033[H\033[2J" if you use printf(); (be sure to flush out yourself as it does'nt contain a newline). HTH, Lokesh. Martijn> Lokesh Setia wrote in message Martijn> news:xnhk8n0yno9.fsf@sh.bel.alcatel.be ... >> Write "clear" in your shell and press enter before you run >> gcc. or type Control-L if you use bash or tcsh as your shell. >> >> Regards, Lokesh. >> >> >> >>>>> "Martijn" == Martijn writes: >> Martijn> Hello everyone, I'm a gcc newbe As in the subject: What Martijn> is the command (or perhaps: trick) to clear your screen Martijn> while running gcc in your terminal-mode? >> Martijn> thanx, >> Martijn> Martijn >> >> >> >> -- When we come back, I'll drop a line. (The Doors) -- When we come back, I'll drop a line. (The Doors) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lokesh Setia To: help-gcc@gnu.org Subject: Re: how to clear screen ?? Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: References: <820mu3$qv5v$1@reader3.wxs.nl> <821ded$ro74$1@reader3.wxs.nl> X-SW-Source: 1999-12n/msg00003.html Message-ID: <19991231222400.I_X6AvpYF1ZFK4JbOpIoPmV6fygNBhMj1WolcndhpWw@z> >>>>> "Martijn" == Martijn writes: Martijn> Thanx for the reaction.... but what I meant was: How can Martijn> I get my screen cleared from within my c-program?? But you said you wanted to clear the screen while running gcc. What you should have said was "while running my gcc-compiled program", unless you're writing gcc of course :) Anyway, the following should work on most systems: system("clear"); or system("tput clear"); or echo the clear's escape code itself, it's usually portable for commonly used terminals, but not always. Find out the code from: [lokeshs@solaris] ~> tput clear | od -c 0000000 033 [ H 033 [ 2 J 0000007 [lokeshs@solaris] ~> So, you print "Esc [ H Esc [ 2 J", that's "\033[H\033[2J" if you use printf(); (be sure to flush out yourself as it does'nt contain a newline). HTH, Lokesh. Martijn> Lokesh Setia wrote in message Martijn> news:xnhk8n0yno9.fsf@sh.bel.alcatel.be ... >> Write "clear" in your shell and press enter before you run >> gcc. or type Control-L if you use bash or tcsh as your shell. >> >> Regards, Lokesh. >> >> >> >>>>> "Martijn" == Martijn writes: >> Martijn> Hello everyone, I'm a gcc newbe As in the subject: What Martijn> is the command (or perhaps: trick) to clear your screen Martijn> while running gcc in your terminal-mode? >> Martijn> thanx, >> Martijn> Martijn >> >> >> >> -- When we come back, I'll drop a line. (The Doors) -- When we come back, I'll drop a line. (The Doors) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lokesh Setia To: help-gcc@gnu.org Subject: Re: how to clear screen ?? Date: Wed, 01 Dec 1999 04:06:00 -0000 Message-ID: References: <820mu3$qv5v$1@reader3.wxs.nl> <821ded$ro74$1@reader3.wxs.nl> X-SW-Source: 1999-q4/msg01029.html Message-ID: <19991201040600.thnuJhlOCgKqPzRBgcGKtj3NL2TEnO6-5xrajKSeVd0@z> >>>>> "Martijn" == Martijn writes: Martijn> Thanx for the reaction.... but what I meant was: How can Martijn> I get my screen cleared from within my c-program?? But you said you wanted to clear the screen while running gcc. What you should have said was "while running my gcc-compiled program", unless you're writing gcc of course :) Anyway, the following should work on most systems: system("clear"); or system("tput clear"); or echo the clear's escape code itself, it's usually portable for commonly used terminals, but not always. Find out the code from: [lokeshs@solaris] ~> tput clear | od -c 0000000 033 [ H 033 [ 2 J 0000007 [lokeshs@solaris] ~> So, you print "Esc [ H Esc [ 2 J", that's "\033[H\033[2J" if you use printf(); (be sure to flush out yourself as it does'nt contain a newline). HTH, Lokesh. Martijn> Lokesh Setia wrote in message Martijn> news: xnhk8n0yno9.fsf@sh.bel.alcatel.be ... >> Write "clear" in your shell and press enter before you run >> gcc. or type Control-L if you use bash or tcsh as your shell. >> >> Regards, Lokesh. >> >> >> >>>>> "Martijn" == Martijn writes: >> Martijn> Hello everyone, I'm a gcc newbe As in the subject: What Martijn> is the command (or perhaps: trick) to clear your screen Martijn> while running gcc in your terminal-mode? >> Martijn> thanx, >> Martijn> Martijn >> >> >> >> -- When we come back, I'll drop a line. (The Doors) -- When we come back, I'll drop a line. (The Doors)