caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremie Dimino <jdimino@janestreet.com>
To: Helmut Brandl <helmut.brandl@gmx.net>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Turn echoing off on standard input to read e.g. passwords
Date: Mon, 1 Apr 2019 10:05:32 +0100	[thread overview]
Message-ID: <CANhEzE6Wpth8y2kz0c_dUOLTqTCUDCFfTZcqiHLTU3D+Hqu_ew@mail.gmail.com> (raw)
In-Reply-To: <21AC2517-8185-45A3-8520-53C92761CBBA@gmx.net>

Hi Helmut,

If you don't mind the extra dependency, there is a complete example in
the lambda-term library:

https://github.com/ocaml-community/lambda-term/blob/master/examples/read_password.ml

The main differences with the other solutions mentioned in this thread
are that this version works on Windows, supports line edition and
supports customisation such as displaying nothing or displaying stars.

Best,

Jeremie

On Thu, Mar 28, 2019 at 8:04 PM Helmut Brandl <helmut.brandl@gmx.net> wrote:
>
> Hello list,
>
> Is there a portable way in ocaml to turn echoing off on standard input from the terminal to read e.g. passwords? By portable I mean that it works for Windows, Unix and Mac.
>
> Thanks for any hint.
>
> Regards
> Helmut



-- 
Jeremie

      parent reply	other threads:[~2019-04-01  9:06 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
2019-03-29  3:05   ` Chet Murthy
2019-03-29 23:13     ` Chet Murthy
2019-04-01  9:05 ` Jeremie Dimino [this message]

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=CANhEzE6Wpth8y2kz0c_dUOLTqTCUDCFfTZcqiHLTU3D+Hqu_ew@mail.gmail.com \
    --to=jdimino@janestreet.com \
    --cc=caml-list@inria.fr \
    --cc=helmut.brandl@gmx.net \
    /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).