[Top][All Lists]

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

Re: newterm problem

From: Thomas Dickey
Subject: Re: newterm problem
Date: Sun, 13 Apr 2008 09:16:09 -0400
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

On Thu, Apr 10, 2008 at 03:49:58PM +0800, Steven Woody wrote:
> The problem is,  in using of newterm( TERM, outfd, infd ), if
>  1, if outfd and infd are same reference to a same terminal, everything
>  seems fine.
>  2, if outfd and infd are referering to different terminal, the
>  cbreak() and noecho() will not take effect.
>  You can check out the simple code listed in the last and run with
>  something like:
>  $ mytest  /dev/pts/0 /dev/pts/0
>  and
>  $ mytest /dev/pts/0 dev/pts/1
>  For the both cases, the `mytest' program is running on /dev/pts/0. In
>  the second case,  you have to switch to another terminal (/dev/pts/1)
>  to do input, and see the outputs in /dev/pts/0.  The result is, in the
>  first case, everything is fine, but in the second case, the input can
>  not immediately received by `mytest', hence there is nothing to print
>  before you press an `enter' key.
>  Could anyone please explain this strange phenomena for me? Where I
>  made any error?

curses (not just ncurses) is designed to work with one terminal on each
screen.  Although newterm accepts two file pointers, curses has only one
set of terminal modes for a terminal, which is reflected in these
lower-level functions:

       int setupterm(char *term, int fildes, int *errret);
       int def_prog_mode(void);
       int def_shell_mode(void);
       int reset_prog_mode(void);
       int reset_shell_mode(void);
       int resetty(void);
       int savetty(void);

Thomas E. Dickey <address@hidden>

Attachment: signature.asc
Description: Digital signature

reply via email to

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