term::ansi::code::attr(3tcl)
term::ansi::code::attr π β¨
okay bestie, sit down, we're talking about the Tcllib page term::ansi::code::attr(3tcl) from the Terminal control manual section. this is the one that gives you cute little symbolic names for ANSI attribute codes so you never have to hand-type an escape sequence again. it's giving "I memorized the color codes so you don't have to" and honestly? iconic. π
πΈ NAME πΈ
term::ansi::code::attr β ANSI attribute sequences
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require term::ansi::code ?0.2?
package require term::ansi::code::attr ?0.2?
::term::ansi::code::attr::names
::term::ansi::code::attr::import ?ns? ?arg...?
::term::ansi::code::attr::fgblack
::term::ansi::code::attr::fgred
::term::ansi::code::attr::fggreen
::term::ansi::code::attr::fgyellow
::term::ansi::code::attr::fgblue
::term::ansi::code::attr::fgmagenta
::term::ansi::code::attr::fgcyan
::term::ansi::code::attr::fgwhite
::term::ansi::code::attr::fgdefault
::term::ansi::code::attr::bgblack
::term::ansi::code::attr::bgred
::term::ansi::code::attr::bggreen
::term::ansi::code::attr::bgyellow
::term::ansi::code::attr::bgblue
::term::ansi::code::attr::bgmagenta
::term::ansi::code::attr::bgcyan
::term::ansi::code::attr::bgwhite
::term::ansi::code::attr::bgdefault
::term::ansi::code::attr::bold
::term::ansi::code::attr::dim
::term::ansi::code::attr::italic
::term::ansi::code::attr::underline
::term::ansi::code::attr::blink
::term::ansi::code::attr::revers
::term::ansi::code::attr::hidden
::term::ansi::code::attr::strike
::term::ansi::code::attr::nobold
::term::ansi::code::attr::noitalic
::term::ansi::code::attr::nounderline
::term::ansi::code::attr::noblink
::term::ansi::code::attr::norevers
::term::ansi::code::attr::nohidden
::term::ansi::code::attr::nostrike
::term::ansi::code::attr::reset
π¦ DESCRIPTION π¦
so basically this package hands you symbolic names for the ANSI attribute control codes. for every single control code there's one command, and that command just returns the code as its result. that's it. that's the whole job. π
big important note, do not skip this: none of the commands in this package write to a channel. like, zero. not one. that part is handled by higher level packages, like term::ansi::send. so don't come for this package when nothing shows up on your terminal β it's not that kind of girl. π
π API π
π INTROSPECTION π
::term::ansi::code::attr::namesβ this one is purely for introspection, bestie. it returns a list containing the names of all the attribute commands. use it when you wanna know what you're working with. π«Ά::term::ansi::code::attr::import ?ns? ?arg...?β this command imports some or all of the attribute commands into the namespacens. by default that namespace isattr. heads up though: it's a relative namespace name, so it drops the imported commands into a child of the current namespace. by default all commands get imported, but you can restrict that by listing the names of the wanted commands after the namespace argument. (yes, the original says "howver". we love a typo era. π)
π¨ ATTRIBUTES π¨
::term::ansi::code::attr::fgblackβ set text color to Black.::term::ansi::code::attr::fgredβ set text color to Red.::term::ansi::code::attr::fggreenβ set text color to Green.::term::ansi::code::attr::fgyellowβ set text color to Yellow.::term::ansi::code::attr::fgblueβ set text color to Blue.::term::ansi::code::attr::fgmagentaβ set text color to Magenta.::term::ansi::code::attr::fgcyanβ set text color to Cyan.::term::ansi::code::attr::fgwhiteβ set text color to White.::term::ansi::code::attr::fgdefaultβ set default text color (Black).::term::ansi::code::attr::bgblackβ set background to Black.::term::ansi::code::attr::bgredβ set background to Red.::term::ansi::code::attr::bggreenβ set background to Green.::term::ansi::code::attr::bgyellowβ set background to Yellow.::term::ansi::code::attr::bgblueβ set background to Blue.::term::ansi::code::attr::bgmagentaβ set background to Magenta.::term::ansi::code::attr::bgcyanβ set background to Cyan.::term::ansi::code::attr::bgwhiteβ set background to White.::term::ansi::code::attr::bgdefaultβ set default background (Transparent).::term::ansi::code::attr::boldβ Bold on.::term::ansi::code::attr::dimβ Dim on.::term::ansi::code::attr::italicβ Italics on.::term::ansi::code::attr::underlineβ Underscore on.::term::ansi::code::attr::blinkβ Blink on.::term::ansi::code::attr::reversβ Reverse on.::term::ansi::code::attr::hiddenβ Hidden on.::term::ansi::code::attr::strikeβ Strike-through on.::term::ansi::code::attr::noboldβ Bold off.::term::ansi::code::attr::noitalicβ Italics off.::term::ansi::code::attr::nounderlineβ Underscore off.::term::ansi::code::attr::noblinkβ Blink off.::term::ansi::code::attr::noreversβ Reverse off.::term::ansi::code::attr::nohiddenβ Hidden off.::term::ansi::code::attr::nostrikeβ Strike-through off.::term::ansi::code::attr::resetβ Reset all attributes to their default values.
π BUGS, IDEAS, FEEDBACK π
ngl bestie, this document and the package it describes will undoubtedly contain bugs and other problems. like, that's just how it is. please report such in the category term of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. and please also report any ideas for enhancements you may have for either the package and/or the documentation. we love a glow-up suggestion. β¨
when proposing code changes, please provide unified diffs, i.e the output of diff -u.
note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. (iykyk π«Ά)
π KEYWORDS π
ansi, attribute control, color control, control, terminal
π CATEGORY π
Terminal control
π COPYRIGHT π
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay and that's the whole page, bestie!! this came to you from tcllib, version 0.2, and the page is term::ansi::code::attr(3tcl) β go color your terminal, you main character π
πΈπ¦ periodt.
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2006 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