term::ansi::code::ctrl(3tcl)
π NAME π
term::ansi::code::ctrl(3tcl) β Terminal control β ANSI control sequences. Bestie, this is part 1 of the manual page, and it's giving symbolic names for ANSI control sequences. π
β¨ SYNOPSIS β¨
Okay so here's the full cast list. Every command, every ?optional?, every ... β no skips, no cap. π«Ά
package require Tcl 8.5 9
package require term::ansi::code ?0.2?
package require term::ansi::code::ctrl ?0.3?
::term::ansi::code::ctrl::names
::term::ansi::code::ctrl::import ?ns? ?arg...?
::term::ansi::code::ctrl::eeol
::term::ansi::code::ctrl::esol
::term::ansi::code::ctrl::el
::term::ansi::code::ctrl::ed
::term::ansi::code::ctrl::eu
::term::ansi::code::ctrl::es
::term::ansi::code::ctrl::sd
::term::ansi::code::ctrl::su
::term::ansi::code::ctrl::ch
::term::ansi::code::ctrl::sc
::term::ansi::code::ctrl::rc
::term::ansi::code::ctrl::sca
::term::ansi::code::ctrl::rca
::term::ansi::code::ctrl::st
::term::ansi::code::ctrl::ct
::term::ansi::code::ctrl::cat
::term::ansi::code::ctrl::qdc
::term::ansi::code::ctrl::qds
::term::ansi::code::ctrl::qcp
::term::ansi::code::ctrl::rd
::term::ansi::code::ctrl::elw
::term::ansi::code::ctrl::dlw
::term::ansi::code::ctrl::eg
::term::ansi::code::ctrl::lg
::term::ansi::code::ctrl::scs0 tag
::term::ansi::code::ctrl::scs1 tag
::term::ansi::code::ctrl::sda arg...
::term::ansi::code::ctrl::sda_fgblack
::term::ansi::code::ctrl::sda_fgred
::term::ansi::code::ctrl::sda_fggreen
::term::ansi::code::ctrl::sda_fgyellow
::term::ansi::code::ctrl::sda_fgblue
::term::ansi::code::ctrl::sda_fgmagenta
::term::ansi::code::ctrl::sda_fgcyan
::term::ansi::code::ctrl::sda_fgwhite
::term::ansi::code::ctrl::sda_fgdefault
::term::ansi::code::ctrl::sda_bgblack
::term::ansi::code::ctrl::sda_bgred
::term::ansi::code::ctrl::sda_bggreen
::term::ansi::code::ctrl::sda_bgyellow
::term::ansi::code::ctrl::sda_bgblue
::term::ansi::code::ctrl::sda_bgmagenta
::term::ansi::code::ctrl::sda_bgcyan
::term::ansi::code::ctrl::sda_bgwhite
::term::ansi::code::ctrl::sda_bgdefault
::term::ansi::code::ctrl::sda_bold
::term::ansi::code::ctrl::sda_dim
::term::ansi::code::ctrl::sda_italic
::term::ansi::code::ctrl::sda_underline
::term::ansi::code::ctrl::sda_blink
::term::ansi::code::ctrl::sda_revers
::term::ansi::code::ctrl::sda_hidden
::term::ansi::code::ctrl::sda_strike
::term::ansi::code::ctrl::sda_nobold
::term::ansi::code::ctrl::sda_noitalic
::term::ansi::code::ctrl::sda_nounderline
::term::ansi::code::ctrl::sda_noblink
::term::ansi::code::ctrl::sda_norevers
::term::ansi::code::ctrl::sda_nohidden
::term::ansi::code::ctrl::sda_nostrike
::term::ansi::code::ctrl::sda_reset
::term::ansi::send::fcp row col
::term::ansi::code::ctrl::cu ?n?
::term::ansi::code::ctrl::cd ?n?
::term::ansi::code::ctrl::cf ?n?
::term::ansi::code::ctrl::cb ?n?
::term::ansi::code::ctrl::ss ?s e?
::term::ansi::code::ctrl::skd code str
::term::ansi::code::ctrl::title str
::term::ansi::code::ctrl::gron
::term::ansi::code::ctrl::groff
::term::ansi::code::ctrl::tlc
::term::ansi::code::ctrl::trc
::term::ansi::code::ctrl::brc
::term::ansi::code::ctrl::blc
::term::ansi::code::ctrl::ltj
::term::ansi::code::ctrl::ttj
::term::ansi::code::ctrl::rtj
::term::ansi::code::ctrl::btj
::term::ansi::code::ctrl::fwj
::term::ansi::code::ctrl::hl
::term::ansi::code::ctrl::vl
::term::ansi::code::ctrl::groptim str
::term::ansi::code::ctrl::clear
::term::ansi::code::ctrl::init
::term::ansi::code::ctrl::showat row col text
πΈ DESCRIPTION πΈ
okay so this package provides symbolic names for the ANSI control sequences. For each sequence, a single command is provided, and that command returns the sequence as its result. It's giving naming layer energy. β¨
None of the commands of this package write to a channel. Nope, not one. That part is handled by higher level packages, like term::ansi::send. So these commands are here to hand you the sequence, and the higher-level besties take care of actually sending it. π
π API π
π INTROSPECTION π
::term::ansi::code::ctrl::namesβ bestie this one is pure introspection. It hands you back a list of the names of all the attribute commands. That's it. That's the whole vibe. π::term::ansi::code::ctrl::import ?ns? ?arg...?β this one yoinks some (or all) of the attribute commands into the namespace ns. Default namespace isctrl, and heads up: it's a relative namespace name, so the imported commands land in a child of the current namespace. By default everything gets imported, but you can restrict it by listing the names of the commands you actually want after the namespace argument. π«Ά
β¨ SEQUENCES β¨
::term::ansi::code::ctrl::eeolβ Erase (to) End Of Line::term::ansi::code::ctrl::esolβ Erase (to) Start Of Line::term::ansi::code::ctrl::elβ Erase (current) Line::term::ansi::code::ctrl::edβ Erase Down (to bottom)::term::ansi::code::ctrl::euβ Erase Up (to top)::term::ansi::code::ctrl::esβ Erase Screen::term::ansi::code::ctrl::sdβ Scroll Down::term::ansi::code::ctrl::suβ Scroll Up::term::ansi::code::ctrl::chβ Cursor Home::term::ansi::code::ctrl::scβ Save Cursor::term::ansi::code::ctrl::rcβ Restore Cursor (Unsave)::term::ansi::code::ctrl::scaβ Save Cursor + Attributes::term::ansi::code::ctrl::rcaβ Restore Cursor + Attributes::term::ansi::code::ctrl::stβ Set Tab (@ current position)::term::ansi::code::ctrl::ctβ Clear Tab (@ current position)::term::ansi::code::ctrl::catβ Clear All Tabs::term::ansi::code::ctrl::qdcβ Query Device Code::term::ansi::code::ctrl::qdsβ Query Device Status::term::ansi::code::ctrl::qcpβ Query Cursor Position::term::ansi::code::ctrl::rdβ Reset Device::term::ansi::code::ctrl::elwβ Enable Line Wrap::term::ansi::code::ctrl::dlwβ Disable Line Wrap::term::ansi::code::ctrl::egβ Enter Graphics Mode::term::ansi::code::ctrl::lgβ Exit Graphics Mode::term::ansi::code::ctrl::scs0 tagβ Set default character set::term::ansi::code::ctrl::scs1 tagβ Set alternate character set. Select Character Set.
So like, choose which character set is used for either the default font (scs0) or the alternate font (scs1). And no cap β this does not change whether the default or alternate font is being used, only their definition. Important distinction bestie. π¦
The legal tags, and their meanings, are:
Aβ United Kingdom SetBβ ASCII Set0β Special Graphics1β Alternate Character ROM Standard Character Set2β Alternate Character ROM Special Graphics
::term::ansi::code::ctrl::sda arg...β Set Display Attributes. The arguments are the code sequences for the possible attributes, as provided by the packageterm::ansi::code::attr. And for convenience this package also gives you extra commands, each one setting a single specific attribute. Obsessed honestly. β¨::term::ansi::code::ctrl::sda_fgblackβ Set text color to Black.::term::ansi::code::ctrl::sda_fgredβ Set text color to Red.::term::ansi::code::ctrl::sda_fggreenβ Set text color to Green.::term::ansi::code::ctrl::sda_fgyellowβ Set text color to Yellow.::term::ansi::code::ctrl::sda_fgblueβ Set text color to Blue.::term::ansi::code::ctrl::sda_fgmagentaβ Set text color to Magenta.::term::ansi::code::ctrl::sda_fgcyanβ Set text color to Cyan.::term::ansi::code::ctrl::sda_fgwhiteβ Set text color to White.::term::ansi::code::ctrl::sda_fgdefaultβ Set default text color (Black).::term::ansi::code::ctrl::sda_bgblackβ Set background to Black.::term::ansi::code::ctrl::sda_bgredβ Set background to Red.::term::ansi::code::ctrl::sda_bggreenβ Set background to Green.::term::ansi::code::ctrl::sda_bgyellowβ Set background to Yellow.::term::ansi::code::ctrl::sda_bgblueβ Set background to Blue.::term::ansi::code::ctrl::sda_bgmagentaβ Set background to Magenta.::term::ansi::code::ctrl::sda_bgcyanβ Set background to Cyan.::term::ansi::code::ctrl::sda_bgwhiteβ Set background to White.::term::ansi::code::ctrl::sda_bgdefaultβ Set default background (Transparent).::term::ansi::code::ctrl::sda_boldβ Bold on.::term::ansi::code::ctrl::sda_dimβ Dim on.::term::ansi::code::ctrl::sda_italicβ Italics on.::term::ansi::code::ctrl::sda_underlineβ Underscore on.::term::ansi::code::ctrl::sda_blinkβ Blink on.::term::ansi::code::ctrl::sda_reversβ Reverse on.::term::ansi::code::ctrl::sda_hiddenβ Hidden on.::term::ansi::code::ctrl::sda_strikeβ Strike-through on.::term::ansi::code::ctrl::sda_noboldβ Bold off.::term::ansi::code::ctrl::sda_noitalicβ Italics off.::term::ansi::code::ctrl::sda_nounderlineβ Underscore off.::term::ansi::code::ctrl::sda_noblinkβ Blink off.::term::ansi::code::ctrl::sda_noreversβ Reverse off.::term::ansi::code::ctrl::sda_nohiddenβ Hidden off.::term::ansi::code::ctrl::sda_nostrikeβ Strike-through off.::term::ansi::code::ctrl::sda_resetβ Reset all attributes to their default values.::term::ansi::send::fcp row colβ Force Cursor Position (aka Go To). β¨::term::ansi::code::ctrl::cu ?n?β Cursor Up. n defaults to1.::term::ansi::code::ctrl::cd ?n?β Cursor Down. n defaults to1.::term::ansi::code::ctrl::cf ?n?β Cursor Forward. n defaults to1.::term::ansi::code::ctrl::cb ?n?β Cursor Backward. n defaults to1.::term::ansi::code::ctrl::ss ?s e?β Scroll Screen (entire display, or between rows start end, inclusive).::term::ansi::code::ctrl::skd code strβ Set Key Definition.::term::ansi::code::ctrl::title strβ Set the terminal title.::term::ansi::code::ctrl::gronβ Switch to character/box graphics. I.e. switch to the alternate font.::term::ansi::code::ctrl::groffβ Switch to regular characters. I.e. switch to the default font.::term::ansi::code::ctrl::tlcβ Character graphics, Top Left Corner.::term::ansi::code::ctrl::trcβ Character graphics, Top Right Corner.::term::ansi::code::ctrl::brcβ Character graphics, Bottom Right Corner.::term::ansi::code::ctrl::blcβ Character graphics, Bottom Left Corner.::term::ansi::code::ctrl::ltjβ Character graphics, Left T Junction.::term::ansi::code::ctrl::ttjβ Character graphics, Top T Junction.::term::ansi::code::ctrl::rtjβ Character graphics, Right T Junction.::term::ansi::code::ctrl::btjβ Character graphics, Bottom T Junction.::term::ansi::code::ctrl::fwjβ Character graphics, Four-Way Junction.::term::ansi::code::ctrl::hlβ Character graphics, Horizontal Line.::term::ansi::code::ctrl::vlβ Character graphics, Vertical Line.::term::ansi::code::ctrl::groptim strβ Optimize character graphics. The generator commands above create way too many superfluous commands shifting into and out of the graphics mode. This command removes all the shifts which aren't needed. And to pull that off, it also knows which characters look the same in both modes β so it can handle strings created outside of this package too. π§::term::ansi::code::ctrl::clearβ Clear screen. In essence a sequence of CursorHome + EraseDown.::term::ansi::code::ctrl::initβ Initialize default and alternate fonts to ASCII and box graphics.::term::ansi::code::ctrl::showat row col textβ Format the block of text for display at the specified location.
π BUGS, IDEAS, FEEDBACK π
Okay so real talk bestie: this document, and the package it describes, will undoubtedly contain bugs and other problems. Fr fr. Please report such in the category term of the Tcllib Trackers [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 want them all. π«Ά
When proposing code changes, please provide unified diffs, i.e the output of diff -u.
Also note β and this one matters β attachments are strongly preferred over inlined patches. You can make an attachment 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-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>
And that's a wrap on term::ansi::code::ctrl(3tcl), bestie β this whole thing is from tcllib, version 0.3, and you made it to the very end, which is honestly main character energy. Go erase a line, slay a cursor, 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-2008 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