Making chars disappear
Tom Christiansen
tchrist at convex.COM
Mon Feb 18 14:51:49 AEST 1991
>From the keyboard of jwm712 at unhd.unh.edu (Jonathan W Miner):
:In article <8531 at castle.ed.ac.uk> james at castle.ed.ac.uk (J Gillespie) writes:
:>
:>Does anyone know of a way to prevent characters being echoed as they
:>are typed in? Like when you log in, your password doesn't get echoed.
:>I have a nasty feeling this may involve sending control codes to the
:>terminal.
:You will have to get the terminal driver to shift into RAW mode. This takes
:away all off the 'nice' features of line-oriented input. Look into the
:ioctl() system call and <sgtty.h>. (I just don't have the time.)
NO! Raw mode doesn't automatically get you no echo. I guess now we'll
have 3 wrong answer and 6 semi-right ones.
This is *not* a C-related question. It's an OS-related question, and
cannot be answered portably. It's very closely related to "how do I get
one character from the keyboard," which doesn't belong here either.
See the answer to the latter question in the FAQ for comp.unix.questions
and interpolate, which you would have known had you read the FAQ for this
group. I'm sorry if this sounds testy. The net is not really supposed to
be a substitute for RTFM or asking around at your own site. And even when
you've no other recourse, reading the FFAQs first would often answer the
simpler questions.
--tom
--
Tom Christiansen tchrist at convex.com convex!tchrist
"All things are possible, but not all expedient." (in life, UNIX, and perl)
More information about the Comp.lang.c
mailing list