linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Size of the terminal with curses
@ 2004-10-20 20:11 Tyler
  2004-10-21 12:05 ` Jan-Benedict Glaw
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tyler @ 2004-10-20 20:11 UTC (permalink / raw)
  To: linux-c-programming

Hey,

How can I get the size of the terminal (in lines and cols) of the actual 
terminal ? It would be cool if the solution uses some curses function.

Thx


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

* Re: Size of the terminal with curses
  2004-10-20 20:11 Size of the terminal with curses Tyler
@ 2004-10-21 12:05 ` Jan-Benedict Glaw
  2004-10-21 13:03   ` Andrei Bunghez
  2004-10-21 12:30 ` Progga
  2004-10-21 23:06 ` simon
  2 siblings, 1 reply; 6+ messages in thread
From: Jan-Benedict Glaw @ 2004-10-21 12:05 UTC (permalink / raw)
  To: linux-c-programming

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

On Wed, 2004-10-20 22:11:23 +0200, Tyler <tyler@agat.net>
wrote in message <cl6gpb$gap$1@sea.gmane.org>:
> How can I get the size of the terminal (in lines and cols) of the actual 
> terminal ? It would be cool if the solution uses some curses function.

It's LINES and COLS, see <curses.h>.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Size of the terminal with curses
  2004-10-20 20:11 Size of the terminal with curses Tyler
  2004-10-21 12:05 ` Jan-Benedict Glaw
@ 2004-10-21 12:30 ` Progga
  2004-10-21 23:06 ` simon
  2 siblings, 0 replies; 6+ messages in thread
From: Progga @ 2004-10-21 12:30 UTC (permalink / raw)
  To: Tyler; +Cc: linux-c-programming

On Wed, Oct 20, 2004 at 10:11:23PM +0200, Tyler wrote:
> 
> How can I get the size of the terminal (in lines and cols) of the actual 
> terminal ? It would be cool if the solution uses some curses function.

 Get the values of the 'LINES' and 'COLUMNS' env variables using getenv().



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

* Re: Size of the terminal with curses
  2004-10-21 12:05 ` Jan-Benedict Glaw
@ 2004-10-21 13:03   ` Andrei Bunghez
  0 siblings, 0 replies; 6+ messages in thread
From: Andrei Bunghez @ 2004-10-21 13:03 UTC (permalink / raw)
  To: linux-c-programming

Hi, 

Calling ioctl with TIOCGWINSZ, would be another soulution... 
(tty_ioctl(4)). However I am no expert, please correct me if the above
doesn't work with curses.

Andrei




On Thu, 21 Oct 2004 14:05:39 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Wed, 2004-10-20 22:11:23 +0200, Tyler <tyler@agat.net>
> wrote in message <cl6gpb$gap$1@sea.gmane.org>:
> > How can I get the size of the terminal (in lines and cols) of the actual
> > terminal ? It would be cool if the solution uses some curses function.
> 
> It's LINES and COLS, see <curses.h>.
> 
> MfG, JBG
> 
> --
> Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
> "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
>  fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
> ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
> 
> 
>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: Size of the terminal with curses
@ 2004-10-21 17:08 yiding_wang
  0 siblings, 0 replies; 6+ messages in thread
From: yiding_wang @ 2004-10-21 17:08 UTC (permalink / raw)
  To: tyler, linux-c-programming

The simplist way - run shell command "set", you will see some setting like 
...
COLUMNS=80 
...
LINES=25
...

It is an environment setting.

Eddie

-----Original Message-----
From: linux-c-programming-owner@vger.kernel.org
[mailto:linux-c-programming-owner@vger.kernel.org]On Behalf Of Tyler
Sent: Wednesday, October 20, 2004 1:11 PM
To: linux-c-programming@vger.kernel.org
Subject: Size of the terminal with curses


Hey,

How can I get the size of the terminal (in lines and cols) of the actual 
terminal ? It would be cool if the solution uses some curses function.

Thx

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Size of the terminal with curses
  2004-10-20 20:11 Size of the terminal with curses Tyler
  2004-10-21 12:05 ` Jan-Benedict Glaw
  2004-10-21 12:30 ` Progga
@ 2004-10-21 23:06 ` simon
  2 siblings, 0 replies; 6+ messages in thread
From: simon @ 2004-10-21 23:06 UTC (permalink / raw)
  To: Tyler; +Cc: linux-C-programming

hello

Tyler wrote:
> Hey,
> 
> How can I get the size of the terminal (in lines and cols) of the actual 
> terminal ? It would be cool if the solution uses some curses function.
nothing to do with ncurses... juste use LINES and COLS macro...

simon

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

end of thread, other threads:[~2004-10-21 23:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-20 20:11 Size of the terminal with curses Tyler
2004-10-21 12:05 ` Jan-Benedict Glaw
2004-10-21 13:03   ` Andrei Bunghez
2004-10-21 12:30 ` Progga
2004-10-21 23:06 ` simon
  -- strict thread matches above, loose matches on Subject: below --
2004-10-21 17:08 yiding_wang

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 NNTP newsgroup(s).