public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Lokesh Setia <lokeshs@sh.bel.alcatel.be>
To: help-gcc@gnu.org
Subject: Re: how to clear screen ??
Date: Fri, 31 Dec 1999 22:24:00 -0000	[thread overview]
Message-ID: <xnhaenuzxg8.fsf@sh.bel.alcatel.be> (raw)
Message-ID: <19991231222400.I_X6AvpYF1ZFK4JbOpIoPmV6fygNBhMj1WolcndhpWw@z> (raw)
In-Reply-To: <821ded$ro74$1@reader3.wxs.nl>

>>>>> "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)

  parent reply	other threads:[~1999-12-31 22:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-30  6:42 Martijn
1999-11-30  8:31 ` Lokesh Setia
1999-11-30 13:02   ` Martijn
1999-11-30 23:28     ` Martijn
1999-12-01  4:06     ` Lokesh Setia [this message]
1999-12-01  4:06       ` Lokesh Setia
1999-12-31 22:24       ` Lokesh Setia
1999-11-30 23:28   ` Lokesh Setia
1999-11-30 13:31 ` Pete Mullins
1999-11-30 23:28   ` Pete Mullins
1999-12-02 11:43   ` Edward A. Falk
1999-12-02 11:43     ` Edward A. Falk
1999-12-31 22:24     ` Edward A. Falk
1999-11-30 23:28 ` Martijn
1999-12-03 13:12 ` David C.
1999-12-31 22:24   ` David C.
  -- strict thread matches above, loose matches on Subject: below --
1999-11-25  6:55 Martijn
1999-11-30 23:28 ` Martijn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xnhaenuzxg8.fsf@sh.bel.alcatel.be \
    --to=lokeshs@sh.bel.alcatel.be \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).