terminal.mli (1401B)
1 (* Like Unix.create_process except that we also try to set up a 2 controlling terminal for the new process. If successful, a file 3 descriptor for the master end of the controlling terminal is 4 returned. *) 5 val create_session : 6 string -> string array -> 7 Unix.file_descr -> Unix.file_descr -> Unix.file_descr -> 8 (Lwt_unix.file_descr * Lwt_unix.file_descr) option * int 9 10 val close_session : int -> unit 11 12 (* [safe_waitpid] is intended for waiting on child processes that are 13 expected to terminate by themselves. If the child process has not 14 terminated after a short while then a SIGTERM is sent and if the 15 child process still doesn't terminate then a SIGKILL is sent. *) 16 val safe_waitpid : int -> Unix.process_status 17 18 (* termInput fdTerm fdInput 19 Wait until there is input on at least one file descriptor. 20 If there is terminal input s, return Some s. 21 Otherwise, return None. *) 22 val termInput : 23 (Lwt_unix.file_descr * Lwt_unix.file_descr) -> Lwt_unix.file_descr -> string option 24 25 type termInteract = { 26 userInput : string -> (string -> unit) -> unit; 27 endInput : unit -> unit } 28 29 val handlePasswordRequests : 30 (Lwt_unix.file_descr * Lwt_unix.file_descr) -> termInteract -> 31 (unit -> string) * string Lwt.t * (unit -> string Lwt.t) 32 33 (* For recognizing messages from OpenSSH *) 34 val password : string -> bool 35 val passphrase : string -> bool 36 val authenticity : string -> bool