Term::C...readkey(3)

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

πŸ’– Term::Completion::_readkey β€” the vibe ✨

ok so bestie, this is the utility package for Term::Completion β€” the lil backstage queen that handles the terminal's "raw" mode and gets it back to normal after. And it does all of that using Term::ReadKey, which is the portable icon that works across, like, many systems. no cap. 🫢

This page lives in the User Contributed Perl Documentation corner of the manual universe, and yes, she's a section 3 girlie (library calls, iykyk).


πŸŽ€ DESCRIPTION πŸŽ€

This utility package contains a few methods that Term::Completion literally cannot live without β€” they're what put the terminal into "raw" mode and then bring it back home safe. 🏠

And the way it does that? It uses Term::ReadKey, which should be portable across many systems. highkey the whole point. ✨

🌸 Methods 🌸

  • set_raw_tty() β€” uses Term::ReadKey's ReadMode 4 to yeet the terminal into "raw" mode, meaning it switches off the meaning of any control characters like CTRL-C etc. 😭 also the echo of characters gets switched off, so the program has full control of what is typed and displayed. main character energy fr. it gets the input file handle from the "in" field of the Term::Completion object.
  • reset_tty() β€” puts the terminal back to its previous state using ReadMode 0. the glow-up reversal, we love a restore point. πŸ’…
  • get_key() β€” reads one byte from the input handle. uses ReadKey. one (1) byte, bestie, that's the whole job. πŸ¦‹
  • get_term_size() β€” figures out the terminal size with GetTerminalSize and returns the list of columns and rows (two integers). just two lil numbers, slay. ✨

πŸ‘‘ AUTHOR πŸ‘‘

Marek Rouchal <marekr@cpan.org>

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. periodt. 🫢

🌈 SEE ALSO 🌈

  • Term::ReadKey

πŸ’– cute lil sign-off: this page is from perl v5.42.0, dated 2025-07-25. bye bestie, go put your terminal in raw mode responsibly πŸ’…βœ¨
πŸ“¦ where this page comes from