term::ansi::ctrl::unix(n)
π 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 βsttyandtputβ 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 isctrl. 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 π
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
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2006-2011 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms