Term::C...n::_stty(3)

πŸ“¦
version 1.02 Β· 2 versions
, in fedora 43

πŸ’… 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() β€” uses stty raw -echo to yeet your terminal into "raw" mode, meaning it switches off the meaning of any control characters like CTRL-C etc. (yes, CTRL-C loses 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 with stty -g and stores that away for later β€” like a little save point. 🫢
heads up: this will work on STDIN and ignore whatever was set as the input handle in Term::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 to stty -raw echo. no state? no problem, we still got a plan B. ✨
  • get_key() β€” reads one byte from the input handle. uses the standard getc(), 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 (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