public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* how to clear screen ??
@ 1999-11-30  6:42 Martijn
  1999-11-30  8:31 ` Lokesh Setia
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Martijn @ 1999-11-30  6:42 UTC (permalink / raw)
  To: help-gcc

Hello everyone,

I'm a gcc newbe
As in the subject: What is the command (or perhaps: trick) to clear your
screen while running gcc in your terminal-mode?

thanx,

Martijn


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-11-30  6:42 how to clear screen ?? Martijn
@ 1999-11-30  8:31 ` Lokesh Setia
  1999-11-30 13:02   ` Martijn
  1999-11-30 23:28   ` Lokesh Setia
  1999-11-30 13:31 ` Pete Mullins
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 18+ messages in thread
From: Lokesh Setia @ 1999-11-30  8:31 UTC (permalink / raw)
  To: help-gcc

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)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  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
  1999-11-30 23:28   ` Lokesh Setia
  1 sibling, 2 replies; 18+ messages in thread
From: Martijn @ 1999-11-30 13:02 UTC (permalink / raw)
  To: help-gcc

Thanx for the reaction....
but what I meant was: How can I get my screen cleared from within my
c-program??

regards.
Martijn

Lokesh Setia <lokeshs@sh.bel.alcatel.be> wrote in message
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)


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-11-30  6:42 how to clear screen ?? Martijn
  1999-11-30  8:31 ` 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-11-30 23:28 ` Martijn
  1999-12-03 13:12 ` David C.
  3 siblings, 2 replies; 18+ messages in thread
From: Pete Mullins @ 1999-11-30 13:31 UTC (permalink / raw)
  To: help-gcc

Martijn <nobody@nowhere.org> wrote in message
news: 820mu3$qv5v$1@reader3.wxs.nl ...
> Hello everyone,
>
> I'm a gcc newbe
> As in the subject: What is the command (or perhaps: trick) to clear your
> screen while running gcc in your terminal-mode?
>

The vt200 code is: esc [ 2 j   (no spaces)

you could write this to standard out. You may need to home the cursor as
well:

esc [ 1 ; 1 H




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-11-30  8:31 ` Lokesh Setia
  1999-11-30 13:02   ` Martijn
@ 1999-11-30 23:28   ` Lokesh Setia
  1 sibling, 0 replies; 18+ messages in thread
From: Lokesh Setia @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

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)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-11-30 13:31 ` Pete Mullins
@ 1999-11-30 23:28   ` Pete Mullins
  1999-12-02 11:43   ` Edward A. Falk
  1 sibling, 0 replies; 18+ messages in thread
From: Pete Mullins @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

Martijn <nobody@nowhere.org> wrote in message
news: 820mu3$qv5v$1@reader3.wxs.nl ...
> Hello everyone,
>
> I'm a gcc newbe
> As in the subject: What is the command (or perhaps: trick) to clear your
> screen while running gcc in your terminal-mode?
>

The vt200 code is: esc [ 2 j   (no spaces)

you could write this to standard out. You may need to home the cursor as
well:

esc [ 1 ; 1 H




^ permalink raw reply	[flat|nested] 18+ messages in thread

* how to clear screen ??
  1999-11-30  6:42 how to clear screen ?? Martijn
  1999-11-30  8:31 ` Lokesh Setia
  1999-11-30 13:31 ` Pete Mullins
@ 1999-11-30 23:28 ` Martijn
  1999-12-03 13:12 ` David C.
  3 siblings, 0 replies; 18+ messages in thread
From: Martijn @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

Hello everyone,

I'm a gcc newbe
As in the subject: What is the command (or perhaps: trick) to clear your
screen while running gcc in your terminal-mode?

thanx,

Martijn


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-11-30 13:02   ` Martijn
@ 1999-11-30 23:28     ` Martijn
  1999-12-01  4:06     ` Lokesh Setia
  1 sibling, 0 replies; 18+ messages in thread
From: Martijn @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

Thanx for the reaction....
but what I meant was: How can I get my screen cleared from within my
c-program??

regards.
Martijn

Lokesh Setia <lokeshs@sh.bel.alcatel.be> wrote in message
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)


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-11-30 13:02   ` Martijn
  1999-11-30 23:28     ` Martijn
@ 1999-12-01  4:06     ` Lokesh Setia
  1999-12-01  4:06       ` Lokesh Setia
  1999-12-31 22:24       ` Lokesh Setia
  1 sibling, 2 replies; 18+ messages in thread
From: Lokesh Setia @ 1999-12-01  4:06 UTC (permalink / raw)
  To: help-gcc

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-12-01  4:06     ` Lokesh Setia
@ 1999-12-01  4:06       ` Lokesh Setia
  1999-12-31 22:24       ` Lokesh Setia
  1 sibling, 0 replies; 18+ messages in thread
From: Lokesh Setia @ 1999-12-01  4:06 UTC (permalink / raw)
  To: help-gcc

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  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
  1 sibling, 2 replies; 18+ messages in thread
From: Edward A. Falk @ 1999-12-02 11:43 UTC (permalink / raw)
  To: help-gcc

In article <38444023_1@news2.prserv.net>, Pete Mullins <pmullin@ibm.net> wrote:
>
>Martijn <nobody@nowhere.org> wrote in message
> news:820mu3$qv5v$1@reader3.wxs.nl ...
>> Hello everyone,
>>
>> I'm a gcc newbe
>> As in the subject: What is the command (or perhaps: trick) to clear your
>> screen while running gcc in your terminal-mode?
>>
>
>The vt200 code is: esc [ 2 j   (no spaces)

Very bad practice unless you know for a fact that the program will
*never* be run on anything but vt200-compatible terminals.

Right way to do this is to learn to use libtermcap.  Easy way to
do this is to call system("clear") as another poster has suggested.

--
-ed falk, falk@falconer.vip.best.com	    *********************#*************#
See http://www.rahul.net/falk/whatToDo.html *#**************F******!******!*!!**
and read 12 Simple Things You Can Do	    ********!***************************
to Save the Internet			    #****#******#*********!**WW*W**W

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-12-02 11:43   ` Edward A. Falk
@ 1999-12-02 11:43     ` Edward A. Falk
  1999-12-31 22:24     ` Edward A. Falk
  1 sibling, 0 replies; 18+ messages in thread
From: Edward A. Falk @ 1999-12-02 11:43 UTC (permalink / raw)
  To: help-gcc

In article < 38444023_1@news2.prserv.net >, Pete Mullins <pmullin@ibm.net> wrote:
>
>Martijn <nobody@nowhere.org> wrote in message
> news: 820mu3$qv5v$1@reader3.wxs.nl ...
>> Hello everyone,
>>
>> I'm a gcc newbe
>> As in the subject: What is the command (or perhaps: trick) to clear your
>> screen while running gcc in your terminal-mode?
>>
>
>The vt200 code is: esc [ 2 j   (no spaces)

Very bad practice unless you know for a fact that the program will
*never* be run on anything but vt200-compatible terminals.

Right way to do this is to learn to use libtermcap.  Easy way to
do this is to call system("clear") as another poster has suggested.

--
-ed falk, falk@falconer.vip.best.com	    *********************#*************#
See http://www.rahul.net/falk/whatToDo.html *#**************F******!******!*!!**
and read 12 Simple Things You Can Do	    ********!***************************
to Save the Internet			    #****#******#*********!**WW*W**W

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-11-30  6:42 how to clear screen ?? Martijn
                   ` (2 preceding siblings ...)
  1999-11-30 23:28 ` Martijn
@ 1999-12-03 13:12 ` David C.
  1999-12-31 22:24   ` David C.
  3 siblings, 1 reply; 18+ messages in thread
From: David C. @ 1999-12-03 13:12 UTC (permalink / raw)
  To: help-gcc

"Martijn" <nobody@nowhere.org> writes:
> 
> I'm a gcc newbe
> As in the subject: What is the command (or perhaps: trick) to clear
> your screen while running gcc in your terminal-mode?

It's actually beyond the scope of a C compiler.  This is in the realm of
system calls.

As was said by others, the curses library is the best way for a Unix app
to manipulate a terminal window.  Check out the man pages for ncurses
for an overview.  It should point you to other man pages for specific
curses functions.  man curs_clear for the curses method of clearning the
screen.

-- David



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-12-03 13:12 ` David C.
@ 1999-12-31 22:24   ` David C.
  0 siblings, 0 replies; 18+ messages in thread
From: David C. @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

"Martijn" <nobody@nowhere.org> writes:
> 
> I'm a gcc newbe
> As in the subject: What is the command (or perhaps: trick) to clear
> your screen while running gcc in your terminal-mode?

It's actually beyond the scope of a C compiler.  This is in the realm of
system calls.

As was said by others, the curses library is the best way for a Unix app
to manipulate a terminal window.  Check out the man pages for ncurses
for an overview.  It should point you to other man pages for specific
curses functions.  man curs_clear for the curses method of clearning the
screen.

-- David



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-12-01  4:06     ` Lokesh Setia
  1999-12-01  4:06       ` Lokesh Setia
@ 1999-12-31 22:24       ` Lokesh Setia
  1 sibling, 0 replies; 18+ messages in thread
From: Lokesh Setia @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: how to clear screen ??
  1999-12-02 11:43   ` Edward A. Falk
  1999-12-02 11:43     ` Edward A. Falk
@ 1999-12-31 22:24     ` Edward A. Falk
  1 sibling, 0 replies; 18+ messages in thread
From: Edward A. Falk @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

In article <38444023_1@news2.prserv.net>, Pete Mullins <pmullin@ibm.net> wrote:
>
>Martijn <nobody@nowhere.org> wrote in message
> news:820mu3$qv5v$1@reader3.wxs.nl ...
>> Hello everyone,
>>
>> I'm a gcc newbe
>> As in the subject: What is the command (or perhaps: trick) to clear your
>> screen while running gcc in your terminal-mode?
>>
>
>The vt200 code is: esc [ 2 j   (no spaces)

Very bad practice unless you know for a fact that the program will
*never* be run on anything but vt200-compatible terminals.

Right way to do this is to learn to use libtermcap.  Easy way to
do this is to call system("clear") as another poster has suggested.

--
-ed falk, falk@falconer.vip.best.com	    *********************#*************#
See http://www.rahul.net/falk/whatToDo.html *#**************F******!******!*!!**
and read 12 Simple Things You Can Do	    ********!***************************
to Save the Internet			    #****#******#*********!**WW*W**W

^ permalink raw reply	[flat|nested] 18+ messages in thread

* how to clear screen ??
  1999-11-25  6:55 Martijn
@ 1999-11-30 23:28 ` Martijn
  0 siblings, 0 replies; 18+ messages in thread
From: Martijn @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

Hello,

When I use gcc, what is the command for clearing the screen??
(like in Fortran  'clrscr')
Should any special header-file be invoked?

Kind regards

Martijn


^ permalink raw reply	[flat|nested] 18+ messages in thread

* how to clear screen ??
@ 1999-11-25  6:55 Martijn
  1999-11-30 23:28 ` Martijn
  0 siblings, 1 reply; 18+ messages in thread
From: Martijn @ 1999-11-25  6:55 UTC (permalink / raw)
  To: help-gcc

Hello,

When I use gcc, what is the command for clearing the screen??
(like in Fortran  'clrscr')
Should any special header-file be invoked?

Kind regards

Martijn


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~1999-12-31 22:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-30  6:42 how to clear screen ?? 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
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

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