This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: how to clear screen ??
- To: help-gcc at gnu dot org
- Subject: Re: how to clear screen ??
- From: Lokesh Setia <lokeshs at sh dot bel dot alcatel dot be>
- Date: 01 Dec 1999 12:56:23 +0100
- Newsgroups: gnu.gcc,gnu.gcc.help
- Organization: Alcatel
- References: <820mu3$qv5v$1@reader3.wxs.nl> <xnhk8n0yno9.fsf@sh.bel.alcatel.be> <821ded$ro74$1@reader3.wxs.nl>
- Xref: wodc7nx0 gnu.gcc.help:2033
>>>>> "Martijn" == Martijn <nobody@nowhere.org> 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 <lokeshs@sh.bel.alcatel.be> 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 <nobody@nowhere.org> 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)