From: glenn@fs.com.au (Glenn Huxtable)
Subject: Re: Odd curses bug - redirected stdout.
Date: Fri, 27 Jan 1995 09:49:27 GMT [thread overview]
Message-ID: <1995Jan27.094927.9336@fs.com.au> (raw)
In-Reply-To: 1995Jan26.110256.21416@fs.com.au
glenn@fs.com.au (Glenn Huxtable) writes:
>Can anyone explain this wierd behaviour of OSF1 curses?
>Curses fails to honour 'nonl', 'noecho' and 'cbreak' (at least) if
>stdout has been redirected?
>Before you say that I'm silly to expect curses to work if stdout is redirected,
>let me say "it fails even if stdout is redirected to stdout!"
... well, I still haven't solved this problem, but I've narrowed it down
further.
The failing curses routines are calling an ioctl TCSETAW, which drains the
output before setting the 'termio' structure.
If stdout is redirected to either '/dev/tty' or to the real terminal
(ie /dev/ttyp1), then the ioctl returns errno = 13 (EPERM or Permission denied).
This should not be so. I own the terminal, it's mode 666 (just to be sure) and
it's *exactly* the same device that stdout was pointing to before it was
redirected.
I've checked other things such as process groups, session groups, controlling
terminal, and they are all the same as in the case where stdout has not been
redirected (and the test program succeeds).
an anyone explain this unusual behaviour of TCSETAW? Better still, can anyone
suggest how I can fix it so that curses (and ioctl) think the redirected
terminal is ok, and have this TCSETAW succeed?
glenn
--
Email - glenn@fs.com.au ,-_|\ glenn huxtable
phone - +61 9 328 8288 / \ functional software
fax - +61 9 328 8616 *_,-._/ PO box 192
v leederville WA 6903
prev parent reply other threads:[~1995-01-27 9:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-01-26 11:02 Odd curses bug - redirected stdout Glenn Huxtable
1995-01-27 9:49 ` Glenn Huxtable [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox