term::ansi::ctrl::unix(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, meet term::ansi::ctrl::unix β€” it's all about control operations and queries. that's the whole vibe. πŸ’…

it lives in the Terminal control manual, section n, and she is very much a unix girlie. ✨


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require term::ansi::ctrl::unix ?0.1.2?

::term::ansi::ctrl::unix::import ?ns? ?arg...?

::term::ansi::ctrl::unix::raw

::term::ansi::ctrl::unix::cooked

::term::ansi::ctrl::unix::columns

::term::ansi::ctrl::unix::rows

🌸 DESCRIPTION 🌸

WARNING: this package is unix-specific, no cap. it literally depends on two unix system commands for terminal control β€” stty and tput β€” and both of them have to be findable in your $PATH. if either one is missing, loading the package will fail. it's giving "no stty no service". 😭

so what does she actually do? two things, and both are iconic:

  • she gives you commands to flip the standard input of the current process between raw and cooked input modes πŸ”„
  • she lets you query the size of terminals, aka the available number of columns and lines πŸ“

that's it, that's the whole job, and she does it flawlessly. periodt.


πŸŽ€ API πŸŽ€

πŸ” INTROSPECTION πŸ”

  • ::term::ansi::ctrl::unix::import ?ns? ?arg...? β€” this one imports some or all of the attribute commands into the namespace ns. by default that namespace is ctrl. and heads up bestie, ns is a relative namespace name, which means it drops the imported command into a child of the current namespace. by default all the commands get imported, but you can restrict that by listing the names of the commands you actually want after the namespace argument. picky but make it fashion. πŸ’…

πŸ¦‹ OPERATIONS πŸ¦‹

  • ::term::ansi::ctrl::unix::raw β€” switches the standard input of the current process to raw input mode. what that means: from then on, every character the user types gets reported to the application immediately, instead of sitting in the OS buffer waiting for the Enter/Return key like it's on read receipts. instant. no filter. ⚑
  • ::term::ansi::ctrl::unix::cooked β€” switches the standard input of the current process to cooked input mode. from then on, all the characters the user types are kept in OS buffers for editing until the Enter/Return key shows up. so it's the polite, "let me finish my sentence first" mode. πŸ“
  • ::term::ansi::ctrl::unix::columns β€” queries the terminal connected to the standard input for the number of columns available for display. πŸ“
  • ::term::ansi::ctrl::unix::rows β€” queries the terminal connected to the standard input for the number of rows (aka lines, same thing bestie) available for display. πŸ“

😭 BUGS, IDEAS, FEEDBACK 😭

ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's not a flaw, it's a personality trait. πŸ™ˆ

please report them in the category term of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist.

also pls report any ideas for enhancements you have for the package and/or the documentation. we want the glow up. ✨

when you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. we love a clean diff.

note further that attachments are strongly preferred over inlined patches. how do you attach? go to the Edit form of the ticket immediately after its creation, then use the left-most button in the secondary navigation bar. iykyk. πŸŽ€


πŸ”₯ KEYWORDS πŸ”₯

ansi, columns, control, cooked, input mode, lines, raw, rows, terminal


πŸ‘‘ CATEGORY πŸ‘‘

Terminal control πŸ’…


Copyright (c) 2006-2011 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page bestie 🫢 this came from tcllib, version 0.1.2, page term::ansi::ctrl::unix(n). go query some columns. slay. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from