caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Helmut Brandl <helmut.brandl@gmx.net>, Matthew Ryan <matthew@o1labs.org>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Turn echoing off on standard input to read e.g. passwords
Date: Thu, 28 Mar 2019 22:12:01 +0100	[thread overview]
Message-ID: <etPan.5c9d38a1.3fe82fc7.8e07@erratique.ch> (raw)
In-Reply-To: <CAHsMTAENQt=0aQS5hUnm=sgbK0NZgUUOCpfQihWTCbw0-jC4xQ@mail.gmail.com>

Just for refence another way (that will in no way work on Windows) is to temporarily tweak the terminal attributes. The ocamlunix book shows how to do this [here][1]. 

In contrast to ANSI escapes which I believe is just a rendering trick that snippet will not allow to cut and paste the input password to recover it, whether that's a property you care about or not is up to your use case.

Best,

Daniel


[1]: https://ocaml.github.io/ocamlunix/files.html#sec49

  parent reply	other threads:[~2019-03-28 21:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 20:03 Helmut Brandl
2019-03-28 20:33 ` Matthew Ryan
2019-03-28 20:40   ` Helmut Brandl
2019-03-28 21:12   ` Daniel Bünzli [this message]
2019-03-29  3:05   ` Chet Murthy
2019-03-29 23:13     ` Chet Murthy
2019-04-01  9:05 ` Jeremie Dimino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=etPan.5c9d38a1.3fe82fc7.8e07@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    --cc=helmut.brandl@gmx.net \
    --cc=matthew@o1labs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).