[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev Re: Slang - ncurses - TeraTerm

From: Klaus Weide
Subject: Re: lynx-dev Re: Slang - ncurses - TeraTerm
Date: Fri, 30 Jul 1999 04:23:21 -0500 (CDT)

On Thu, 29 Jul 1999, T.E.Dickey wrote:

> That's because curses reads from stdin and writes to stdout (standards are
> useful).  I guess slang doesn't follow that standard, if it "works" in that
> case.  The shell script's stdin is passed down to subprocesses, but you can
> override any of them.

I don't think slang claims to be curses-compatible, so it doesn't have
to follow curses standards...

Lynx with slang is normally using fd 0 (i.e. the same as stdin) because
we are explicitly telling it to do so in start_curses():

   #ifdef UNIX
   #if SLANG_VERSION >= 9935
           SLang_TT_Read_FD = fileno(stdin);
   #endif /* SLANG_VERSION >= 9935 */
   #endif /* UNIX */

"Normally" means if fd 0 is indeed a tty.  IIRC without this slang
would open "/dev/tty" with its own fd, and use that to read input.
One reason for making stalng use fd 0 is to make programs work that
determine an interactive session's idle time by checking the tty
device file's atime (like "w", "finger", or idle process killer

Some tests (with lsof, strace) show that slang ignores the pre-set
SLang_TT_Read_FD if fd 0 is a pipe, it still opens its own connection
to "/dev/tty".  (linux 2.0.xx, slang lib is slang1 1.2.2-2 Debian
package; previous versions seem to have behaved the same.)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]