From owner-freebsd-questions@FreeBSD.ORG Tue Jan 19 15:52:21 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D16111065693 for ; Tue, 19 Jan 2010 15:52:21 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 91CB38FC17 for ; Tue, 19 Jan 2010 15:52:21 +0000 (UTC) Received: from r55.edvax.de (port-92-195-164-220.dynamic.qsc.de [92.195.164.220]) by mx02.qsc.de (Postfix) with ESMTP id EE67F1EB09; Tue, 19 Jan 2010 16:52:19 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id o0JFqIoY002434; Tue, 19 Jan 2010 16:52:19 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 19 Jan 2010 16:52:18 +0100 From: Polytropon To: Gary Kline Message-Id: <20100119165218.0f6473e5.freebsd@edvax.de> In-Reply-To: <20100119002838.GB11545@thought.org> References: <20100118033426.GA7585@thought.org> <20100118212136.95b56398.freebsd@edvax.de> <20100119002838.GB11545@thought.org> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: curses init in one line? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 15:52:21 -0000 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 . 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, typeahead 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 idea: #!/bin/sh DIALOG=${DIALOG=/usr/bin/dialog} This is some kind of "init ncurses in one line". More examples here: /usr/share/examples/dialog/ -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...