[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: old curses and ncurses "initscr" specification
From: |
Thomas Dickey |
Subject: |
Re: old curses and ncurses "initscr" specification |
Date: |
Fri, 24 Jan 2014 16:48:33 -0500 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Thu, Jan 23, 2014 at 11:26:02AM -0500, Ruslan Nabioullin wrote:
> This question isn't about ncurses per se, but this is probably the
> ideal place to ask. Does "initscr" in "old versions of curses,
> e.g., BSD 4.4" upon error print error msg(s) and restore the
> terminal?
I don't have a live system with BSD 4.4 curses to validate this.
(Taking into account the history of FreeBSD/NetBSD/OpenBSD, that would
have to be early 1990s, and none of the vendor Unix's delivered a 4.4
library as far as I recall).
> Also, does ncurses "initscr" restore the terminal upon error? This
> is missing from the man page (at least in ncurses 5.9).
If initscr fails, this is almost always before attempting to modify
the terminal settings. If it doesn't restore the settings (aside say
from an I/O error which prevents it from doing so), it would be a bug.
Likewise, endwin is supposed to restore the settings.
(occasionally someone asks about running in a pipe or connected to
a socket - those aren't expected configurations, and a bug may lurk ther).
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature