term::ansi::code::ctrl(3tcl)

πŸ“¦
version 2.0 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 is ctrl, 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 Set
  • B β€” ASCII Set
  • 0 β€” Special Graphics
  • 1 β€” Alternate Character ROM Standard Character Set
  • 2 β€” 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 package term::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 to 1.
  • ::term::ansi::code::ctrl::cd ?n? β€” Cursor Down. n defaults to 1.
  • ::term::ansi::code::ctrl::cf ?n? β€” Cursor Forward. n defaults to 1.
  • ::term::ansi::code::ctrl::cb ?n? β€” Cursor Backward. n defaults to 1.
  • ::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 (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