Term::C...n::_stty(3)
π NAME π
okay bestie, gather round β this is Term::Completion::_stty, a little utility package that hangs out with Term::Completion and does all its stty-based business. no cap, that's literally the whole job description.
π DESCRIPTION π
so here's the tea: this utility package is packing a few methods that Term::Completion needs in order to flip your terminal into "raw" mode and then back again. it gets the job done using the stty utility β which, lowkey, is probably only available on UNIX, so if you're not on a UNIX-y vibe, this might just not be it. π
and fr fr, this is basically a copy of the original Term::Complete β it's here purely for compatibility reasons. the way that you should actually be doing this is with the Term::Completion::_POSIX implementation instead. periodt. π
β¨ Methods β¨
set_raw_tty()β usesstty raw -echoto yeet your terminal into "raw" mode, meaning it switches off the meaning of any control characters likeCTRL-Cetc. (yes,CTRL-Closes its power, iconic behavior honestly π). also, the echo of characters gets switched off too, so the program has full control of what is typed and displayed. before any of that, it tries to capture the terminal's current state withstty -gand stores that away for later β like a little save point. π«Ά
heads up: this will work onSTDINand ignore whatever was set as the input handle inTerm::Completion. so don't come for it about that.
reset_tty()β puts the terminal back to its previous state, using that saved state from before. if the saved state is unavailable, it falls back tostty -raw echo. no state? no problem, we still got a plan B. β¨get_key()β reads one byte from the input handle. uses the standardgetc(), see also"getc"in perlfunc. simple, clean, does the thing. π
πΈ AUTHOR πΈ
Marek Rouchal <marekr@cpan.org>
also, some reused code from Term::Complete which is part of the Perl core distribution. giving credit where credit is due, always. π
π COPYRIGHT π
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. slay. π
π SEE ALSO π
Term::Complete
that's the whole page bestie, you ate it up π
β¨ β this was pulled from perl v5.42.0 and dated 2025-07-25, so you know it's fresh. now go forth and stty responsibly, mwah π«ΆπΈ
π¦ where this page comes from
- fedora 43: perl-Term-Completion 1.02-6.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms