Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jan 2010 16:52:18 +0100
From:      Polytropon <>
To:        Gary Kline <>
Cc:        FreeBSD Mailing List <>
Subject:   Re: curses init in one line?
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Mon, 18 Jan 2010 16:28:38 -0800, Gary Kline <> wrote:
> 	ps: re Subject line, I remember it let you use /bin/sh without hittin
> 	enter or <cr>.  there's no easy way of doing that in C!

In one line?

initscr(); cbreak(); noecho(); nonl(); intrflush(stdscr, FALSE); keypad(stdscr, TRUE); start_color();


The meaning of this "init dance" is explained in the manpage
of curs_inopts - "curses input options":

       cbreak, nocbreak, echo, noecho, halfdelay, intrflush, keypad, meta,
       nodelay, notimeout, raw, noraw, noqiflush, qiflush, timeout, wtimeout,

The start_color() function is mentioned in "man curs_color" and
is only needed if you want to use colors.

For shell scripts, the use of the dialog programs is a good


This is some kind of "init ncurses in one line". More
examples here: /usr/share/examples/dialog/

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Want to link to this message? Use this URL: <>