The termios functions can be used to modify the behavior of Guile ports. However, not all Guile ports have a terminal line interface.
For a port to have a terminal line interface, it must have an
underlying file descriptor upon which termios procedure may operate.
To test if a port has a file descriptor the Guile
procedure may be used.
Given file port or an integer file descriptor, this procedure returns
#<termios> type containing the terminal line properties of
the port or file descriptor.
Given file port or an integer file descriptor, this procedure sets terminal line properties of the port or file descriptor to those in termios.
If option is TCSANOW, the change shall occur immediately.
If it is TCSADRAIN, the change shall occur after all output written to the the port is transmitted. This function should be used when changing parameters that affect output.
If it is TCSAFLUSH, the change shall occur after all output written to the port is transmitted, and all input so far received but not read shall be discarded before the change is made.
tcdrain procedure blocks until all output written to
fd-or-port is transmitted.
This procedure suspends transmission or reception of data on the given
integer file descriptor or file port depending on the value of
action. If action is
TCOOFF, output is
suspended. If action is
TCOON, suspended output is
restarted. If it is
TCIOFF, it transmits a STOP character,
which stops the terminal device from transmitting data to the
system. If it is
TCION, it transmits a START character, which
starts the terminal device transmitting data to the system.
This procedure discards data written to the given fd-or-port but
not transmitted, or data received but not read, depending on the value
of queue_selector: If action is
TCIFLUSH, it shall flush
data received but not read. If action is
shall flush data written but not transmitted. If action is
TCIOFLUSH, it shall flush both data received but not read and
data written but not transmitted.