Eio_unix.PtyCreating and controlling pseudoterminals.
Pseudoterminal (PTY) support.
A pseudoterminal is a pair of connected file descriptors emulating a terminal. The pseudoterminal device is used by a controlling program such as a terminal emulator, while the terminal device is used by a child process as its controlling terminal.
val open_pty : sw:Eio.Std.Switch.t -> unit -> tval name : t -> stringname t is the path of the terminal device.
val source :
t ->
[ `Unix_fd | Eio.Resource.close_ty | Eio.Flow.source_ty ] Eio.Std.rsource t reads the output the child writes to terminal.
val sink :
t ->
[ `Unix_fd | Eio.Resource.close_ty | Eio.Flow.sink_ty ] Eio.Std.rsink t writes input for the child to read from its terminal.
type winsize = {rows : int;Height of the terminal in character rows.
*)cols : int;Width of the terminal in character columns.
*)xpixel : int;Width in pixels (0 if unknown).
ypixel : int;Height in pixels (0 if unknown).
}Terminal window dimensions.
set_window_size fd ws sets the window size of terminal fd.
Setting it on the pty end updates the terminal and delivers SIGWINCH to the foreground process group attached to the terminal.
module Tc : sig ... endTerminal attributes control. These raise Unix.Unix_error if fd is not a terminal.