Term::Completion::_stty - utility package for Term::Completion using stty
This utility package contains few methods that are required for Term::Completion to put the terminal in "raw" mode and back. This package uses the stty utility, which however is probably only available on UNIX.
stty
This is basically a copy from the original Term::Complete and provided for compatibility reasons. Instead of this, the Term::Completion::_POSIX implementation should be used.
Uses stty raw -echo to set the terminal into "raw" mode, i.e. switch off the meaning of any control characters like CTRL-C etc. Also the echo of characters is switched off, so that the program has full control of what is typed and displayed.
stty raw -echo
Before doing that, tries to capture the terminal's current state with stty -g and stores that for later use.
stty -g
Will work on STDIN and ignore what was set as the input handle in Term::Completion.
Resets the terminal to its previous state, using the saved state. If that's unavailable, fall back to stty -raw echo.
stty -raw echo
Reads one byte from the input handle. Uses standard getc(), see also "getc" in perlfunc.
Marek Rouchal <marekr@cpan.org>
Reused code from Term::Complete which is part of the Perl core distribution.
Copyright (c) 2009, Marek Rouchal. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
Term::Complete
To install Term::Completion, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Term::Completion
CPAN shell
perl -MCPAN -e shell install Term::Completion
For more information on module installation, please visit the detailed CPAN module installation guide.