Date: Wed, 28 Feb 2001 19:13:25 -0500 From: "gerald stoller" <gerald_stoller@hotmail.com> To: ahl@austclear.com.au Cc: freebsd-questions@FreeBSD.ORG Subject: Re: stty -echo Message-ID: <F183XWtjik38dWMJ69i00001fd5@hotmail.com>
next in thread | raw e-mail | index | archive | help
    On Tue, 27 Feb 2001, Tony Landells wrote:
>So what version of FreeBSD did you say you were using?
>
>It works fine for me on both 3.2-RELEASE and 4.2-RELEASE if I avoid
>a shell with builtin line editing.  So on 3.2 /bin/sh and /bin/csh
>are fine, but on 4.2 /bin/csh is actually tcsh which doesn't work
>because it does line editing.
>
>And if you really want to catch out the line-editing shells open
>two windows on your FreeBSD box, find the tty on one, and then use
>the other one to look at the stty settings of the first one (while
>it's sitting idle at the command line):
>
>session1 % echo $version
>tcsh 6.09.01 (Astron) 2000-01-14 (i386-intel-FreeBSD) options 
>8b,nls,dl,al,kan,sm,rh,color,dspm
>session1 % tty
>/dev/ttyp0
>
>session2 $ stty -f /dev/ttyp0
>speed 9600 baud;
>lflags: -icanon -iexten -echo echoe echoke echoctl
>iflags: inlcr
>oflags: -oxtabs
>cflags: cs8 -parenb
>dsusp   eof     lnext   reprint status  susp    werase
><undef> <undef> <undef> <undef> <undef> <undef> <undef>
>
>And for the record, here's what it looks like with /bin/sh on both 3.2 and 
>4.2.  Note that when I turn off echo, you don't get to see where I've typed 
>"stty -a", and when I turn echo back on you just see two'$ ' prompts in a 
>row because echo is still off when I type
>"stty echo".
>Cheers,
>Tony
>
>$ uname -a
>FreeBSD nameserver.austclear.com.au 3.2-RELEASE FreeBSD 3.2-RELEASE #3: Wed 
>Aug 16 17:41:12 EST 2000     
>root@testfw.brokerserv.com.au:/usr/src/sys/compile/ACSFW  i386
>$ echo $SHELL
>/bin/sh
>$ stty -a
>speed 9600 baud; 24 rows; 80 columns;
>lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
>         -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
>         -extproc
>iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
>         brkint -inpck -ignpar -parmrk
>oflags: opost onlcr -oxtabs
>cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
>         -dtrflow -mdmbuf
>cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
>         eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
>         min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
>         stop = ^S; susp = ^Z; time = 0; werase = ^W;
>$ stty -echo
>$ speed 9600 baud; 24 rows; 80 columns;
>lflags: icanon isig iexten -echo echoe -echok echoke -echonl echoctl
>         -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
>         -extproc
>iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
>         brkint -inpck -ignpar -parmrk
>oflags: opost onlcr -oxtabs
>cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
>         -dtrflow -mdmbuf
>cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
>         eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
>         min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
>         stop = ^S; susp = ^Z; time = 0; werase = ^W;
>$ $ stty -a
>speed 9600 baud; 24 rows; 80 columns;
>lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
>         -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
>         -extproc
>iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
>         brkint -inpck -ignpar -parmrk
>oflags: opost onlcr -oxtabs
>cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
>         -dtrflow -mdmbuf
>cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
>         eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
>         min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
>         stop = ^S; susp = ^Z; time = 0; werase = ^W;
>
>$ uname -a
>FreeBSD ns1.austclear.com.au 4.2-STABLE FreeBSD 4.2-STABLE #1: Thu Feb 15 
>15:57:29 EST 2001     root@freddo.austclear.com.au:/usr/src/sys/compile/FW  
>i386
>$ stty -a
>speed 9600 baud; 24 rows; 80 columns;
>lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
>         -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
>         -extproc
>iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
>         brkint -inpck -ignpar -parmrk
>oflags: opost onlcr -oxtabs
>cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
>         -dtrflow -mdmbuf
>cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
>         eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
>         min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
>         stop = ^S; susp = ^Z; time = 0; werase = ^W;
>$ stty -echo
>$ speed 9600 baud; 24 rows; 80 columns;
>lflags: icanon isig iexten -echo echoe -echok echoke -echonl echoctl
>         -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
>         -extproc
>iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
>         brkint -inpck -ignpar -parmrk
>oflags: opost onlcr -oxtabs
>cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
>         -dtrflow -mdmbuf
>cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
>         eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
>         min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
>         stop = ^S; susp = ^Z; time = 0; werase = ^W;
>$ $ stty -a
>speed 9600 baud; 24 rows; 80 columns;
>lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
>         -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
>         -extproc
>iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
>         brkint -inpck -ignpar -parmrk
>oflags: opost onlcr -oxtabs
>cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
>         -dtrflow -mdmbuf
>cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
>         eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
>         min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
>         stop = ^S; susp = ^Z; time = 0; werase = ^W;
>
      The version I am using is
FreeBSD  4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000    
  jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386
      Before you wrote, I had tried using two windows, but I hadn't tried  
/bin/sh .  I nearly always use  ksh .  I found some more strange operation 
when I used two windows; I believe that one window can check on another's 
settings by using  stty -f /dev/ttyX  (with the appropriate value for  X ), 
but this always showed  -echo  no matter how the window was set and even 
though I did change the window's setting re  echo .  Even so,  echo  was 
always on at that window ( ttyX ), I could never turn it off.
      I tried  /bin/sh  recently and it behaved just as  ksh  did, I 
couldn't stop it from echoing.  When I use  ksh , it is set for using  vi  
as the command-line editor; soon I may try it without that feature enabled, 
but at work (where I use  HP-UX ) I have no problem using  stty  to turn  
echo  off & on, and I have noticed the doubled prompt resulting from  echo  
being off.  I may try duplicating your commands on my system soon, it all 
depends on what other things I have to do.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F183XWtjik38dWMJ69i00001fd5>
