From 0e6bfb3cba2e80bf14ca59c14ef57c35d138d892 Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Sun, 5 Oct 2014 23:13:06 -0400 Subject: [PATCH 1/1] client: function to check if stdin is a tty --- src/client.sig | 2 ++ src/client.sml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/client.sig b/src/client.sig index 8cf8cd4..4b4b571 100644 --- a/src/client.sig +++ b/src/client.sig @@ -24,6 +24,8 @@ signature CLIENT = sig | Aborted | Error + val hastty : unit -> bool + val getpass : unit -> passwd_result (* Standard non-echoed console password input with confirmation *) end diff --git a/src/client.sml b/src/client.sml index 0c4112f..a92b13f 100644 --- a/src/client.sml +++ b/src/client.sml @@ -25,6 +25,9 @@ datatype passwd_result = | Aborted | Error +fun hastty () = + Posix.ProcEnv.isatty Posix.FileSys.stdin + fun getpass () = let val tty = Posix.FileSys.stdin -- 2.20.1