Subject: Re: Help w/ serial printer
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 01/10/1996 02:42:53
> [A] big problem is that, IMHO, there should be a way to make ttyecho
> NOT echo.

Right, there should.

> ttyecho(c, tp)
[...]
>         if ((!ISSET(tp->t_lflag, ECHO) &&
>             (!ISSET(tp->t_lflag, ECHONL) || c == '\n')) ||
>             ISSET(tp->t_lflag, EXTPROC))
>                 return;

Well, it looks as though setting EXTPROC should be a master disable for
ttyecho().  Of course, it may have other effects. :-)

> As it stands, I don't see a way to turn off echoing in general.  I
> thought "stty -echo" was a master disable, [...]

I don't think so.  I think that echonl is supposed to make newlines
echo even when -echo...and that's what it looks as though that
conditional is doing.  If I reformat it so as to make it a little more
readable,

        if ( ( !ISSET(tp->t_lflag,ECHO) &&
               ( !ISSET(tp->t_lflag,ECHONL) ||
                 c == '\n' ) ) ||
             ISSET(tp->t_lflag,EXTPROC) )

which looks very odd.  I think the "c == '\n'" should be "c != '\n'";
as it stands, "-echo echonl" mode echoes everything _but_ newlines.  (I
even tried this on my handy NetBSD system, and this is exactly what
happens.  I'll send-pr it.)

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu