Terminal-MakeRaw
NAME
Terminal::MakeRaw
Synopsis
use Terminal::MakeRaw;
# Save the current terminal attributes.
my $saved_termios = Terminal::MakeRaw::getattr($*IN.native-descriptor);
# Change the terminal to raw mode.
Terminal::MakeRaw::makeraw($*IN.native-descriptor, :FLUSH);
# And once we're done, reset the terminal to it's previous state.
Terminal::MakeRaw.setattr($*IN.native-descriptor, $saved_termios, :FLUSH);
Description
Set and reset a terminal to raw mode using the termios native interface.
This module is a stripped down version of Term::termios
. I contrast to the
more feature rich Term::termios
, this module does not require a compiler
to be built.
Flags
Terminal::MakeRaw::makeraw
and Terminal::MakeRaw.setattr
can take one of
the following flags that determine when the changes should take effect:
- NOW
- The default. The changes are applied immediately.
- DRAIN
- The changes are applied after all output written to the FD has been sent.
- FLUSH
- The changes are applied after all output written to the FD has been sent. All input that has been received but not read will be discarded.
See the manpage termios(3) for information about the flags and the
termios
API in general.
AUTHOR
Patrick Böker <[email protected]>
Originally based on Term::termios
by Karl Rune Nilsen et al.
License
This module is distributed under the terms of the Artistic License 2.0.