term::ansi::send(3tcl)

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

πŸ’– term::ansi::send(3tcl) β€” Terminal control πŸ’–

okay so bestie, welcome to the manual for term::ansi::send β€” it's giving Terminal control and it's literally the output of ANSI control sequences to terminals. No cap. πŸ¦‹


✨ NAME ✨

term::ansi::send β€” Output of ANSI control sequences to terminals. That's the whole vibe. It sends the fancy escape codes that make your terminal do cute little tricks. πŸ’…


🌈 SYNOPSIS 🌈

First things first, you need Tcl and the package. Like:

package require Tcl 8.5 9

package require term::ansi::send ?0.2?

Then it's a whole menu of procs. Here's every single one, exactly as they come, no edits, no cap:

::term::ansi::send::import ?ns? ...

::term::ansi::send::eeol

::term::ansi::send::esol

::term::ansi::send::el

::term::ansi::send::ed

::term::ansi::send::eu

::term::ansi::send::es

::term::ansi::send::sd

::term::ansi::send::su

::term::ansi::send::ch

::term::ansi::send::sc

::term::ansi::send::rc

::term::ansi::send::sca

::term::ansi::send::rca

::term::ansi::send::st

::term::ansi::send::ct

::term::ansi::send::cat

::term::ansi::send::qdc

::term::ansi::send::qds

::term::ansi::send::qcp

::term::ansi::send::rd

::term::ansi::send::elw

::term::ansi::send::dlw

::term::ansi::send::eg

::term::ansi::send::lg

::term::ansi::send::scs0 tag

::term::ansi::send::scs1 tag

::term::ansi::send::sda arg...

::term::ansi::send::sda_fgblack

::term::ansi::send::sda_fgred

::term::ansi::send::sda_fggreen

::term::ansi::send::sda_fgyellow

::term::ansi::send::sda_fgblue

::term::ansi::send::sda_fgmagenta

::term::ansi::send::sda_fgcyan

::term::ansi::send::sda_fgwhite

::term::ansi::send::sda_fgdefault

::term::ansi::send::sda_bgblack

::term::ansi::send::sda_bgred

::term::ansi::send::sda_bggreen

::term::ansi::send::sda_bgyellow

::term::ansi::send::sda_bgblue

::term::ansi::send::sda_bgmagenta

::term::ansi::send::sda_bgcyan

::term::ansi::send::sda_bgwhite

::term::ansi::send::sda_bgdefault

::term::ansi::send::sda_bold

::term::ansi::send::sda_dim

::term::ansi::send::sda_italic

::term::ansi::send::sda_underline

::term::ansi::send::sda_blink

::term::ansi::send::sda_revers

::term::ansi::send::sda_hidden

::term::ansi::send::sda_strike

::term::ansi::send::sda_nobold

::term::ansi::send::sda_noitalic

::term::ansi::send::sda_nounderline

::term::ansi::send::sda_noblink

::term::ansi::send::sda_norevers

::term::ansi::send::sda_nohidden

::term::ansi::send::sda_nostrike

::term::ansi::send::sda_reset

::term::ansi::send::fcp row col

::term::ansi::send::cu ?n?

::term::ansi::send::cd ?n?

::term::ansi::send::cf ?n?

::term::ansi::send::cb ?n?

::term::ansi::send::ss ?s e?

::term::ansi::send::skd code str

::term::ansi::send::title str

::term::ansi::send::gron

::term::ansi::send::groff

::term::ansi::send::tlc

::term::ansi::send::trc

::term::ansi::send::brc

::term::ansi::send::blc

::term::ansi::send::ltj

::term::ansi::send::ttj

::term::ansi::send::rtj

::term::ansi::send::btj

::term::ansi::send::fwj

::term::ansi::send::hl

::term::ansi::send::vl

::term::ansi::send::groptim str

::term::ansi::send::clear

::term::ansi::send::init

::term::ansi::send::showat row col text

✨ DESCRIPTION ✨

okay so this package gives you commands that yeet ANSI terminal control sequences straight to a terminal. πŸ’… Every command comes in two variants: one that sends to any channel, and one that sends to stdout. slay.

The commands are built from the control sequences from term::ansi::code::ctrl. They take the same arguments as the commands they're based on, except for the any-channel variant β€” that one always takes a channel handle first, then the original args. Below we're only listing the stdout variant, bestie. 🫢

  • ::term::ansi::send::import ?ns? ... β€” Imports the commands of this package into the namespace ns. If you don't specify it, it defaults to send. Heads up: that default is a relative namespace name, so the actual namespace gets created under the current namespace. By default all commands get imported, but you can restrict it to specific commands by listing them after the namespace you're importing into. πŸ’–

🫢 The Command Lineup 🫢

  • ::term::ansi::send::eeol β€” Erase (to) End Of Line. ✨
  • ::term::ansi::send::esol β€” Erase (to) Start Of Line. ✨
  • ::term::ansi::send::el β€” Erase (current) Line. ✨
  • ::term::ansi::send::ed β€” Erase Down (to bottom). ✨
  • ::term::ansi::send::eu β€” Erase Up (to top). ✨
  • ::term::ansi::send::es β€” Erase Screen. ✨
  • ::term::ansi::send::sd β€” Scroll Down. ✨
  • ::term::ansi::send::su β€” Scroll Up. ✨
  • ::term::ansi::send::ch β€” Cursor Home. ✨
  • ::term::ansi::send::sc β€” Save Cursor. Note: Only one saved position can be handled. This is no unlimited stack. Saving before restoring will overwrite the saved data. 😭
  • ::term::ansi::send::rc β€” Restore Cursor (Unsave). ✨
  • ::term::ansi::send::sca β€” Save Cursor + Attributes. ✨
  • ::term::ansi::send::rca β€” Restore Cursor + Attributes. ✨
  • ::term::ansi::send::st β€” Set Tab (@ current position). ✨
  • ::term::ansi::send::ct β€” Clear Tab (@ current position). ✨
  • ::term::ansi::send::cat β€” Clear All Tabs. ✨
  • ::term::ansi::send::qdc β€” Query Device Code. ✨
  • ::term::ansi::send::qds β€” Query Device Status. ✨
  • ::term::ansi::send::qcp β€” Query Cursor Position. ✨
  • ::term::ansi::send::rd β€” Reset Device. ✨
  • ::term::ansi::send::elw β€” Enable Line Wrap. ✨
  • ::term::ansi::send::dlw β€” Disable Line Wrap. ✨
  • ::term::ansi::send::eg β€” Enter Graphics Mode. ✨
  • ::term::ansi::send::lg β€” Exit Graphics Mode. ✨
  • ::term::ansi::send::scs0 tag / ::term::ansi::send::scs1 tag β€” Select Character Set. πŸŽ€

Choose which character set is used for default (scs0) and alternate font (scs1). This does not change whether default or alternate font are used, just their definitions.

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::send::sda arg... β€” Set Display Attributes. The arguments are the code sequences for the possible attributes, as provided by the package term::ansi::code::attr. For convenience this package also provides additional commands, each setting a single specific attribute. πŸ’–
  • ::term::ansi::send::sda_fgblack β€” Set text color to Black.
  • ::term::ansi::send::sda_fgred β€” Set text color to Red.
  • ::term::ansi::send::sda_fggreen β€” Set text color to Green.
  • ::term::ansi::send::sda_fgyellow β€” Set text color to Yellow.
  • ::term::ansi::send::sda_fgblue β€” Set text color to Blue.
  • ::term::ansi::send::sda_fgmagenta β€” Set text color to Magenta.
  • ::term::ansi::send::sda_fgcyan β€” Set text color to Cyan.
  • ::term::ansi::send::sda_fgwhite β€” Set text color to White.
  • ::term::ansi::send::sda_fgdefault β€” Set default text color (Black).
  • ::term::ansi::send::sda_bgblack β€” Set background to Black.
  • ::term::ansi::send::sda_bgred β€” Set background to Red.
  • ::term::ansi::send::sda_bggreen β€” Set background to Green.
  • ::term::ansi::send::sda_bgyellow β€” Set background to Yellow.
  • ::term::ansi::send::sda_bgblue β€” Set background to Blue.
  • ::term::ansi::send::sda_bgmagenta β€” Set background to Magenta.
  • ::term::ansi::send::sda_bgcyan β€” Set background to Cyan.
  • ::term::ansi::send::sda_bgwhite β€” Set background to White.
  • ::term::ansi::send::sda_bgdefault β€” Set default background (Transparent).
  • ::term::ansi::send::sda_bold β€” Bold on.
  • ::term::ansi::send::sda_dim β€” Dim on.
  • ::term::ansi::send::sda_italic β€” Italics on.
  • ::term::ansi::send::sda_underline β€” Underscore on.
  • ::term::ansi::send::sda_blink β€” Blink on.
  • ::term::ansi::send::sda_revers β€” Reverse on.
  • ::term::ansi::send::sda_hidden β€” Hidden on.
  • ::term::ansi::send::sda_strike β€” Strike-through on.
  • ::term::ansi::send::sda_nobold β€” Bold off.
  • ::term::ansi::send::sda_noitalic β€” Italics off.
  • ::term::ansi::send::sda_nounderline β€” Underscore off.
  • ::term::ansi::send::sda_noblink β€” Blink off.
  • ::term::ansi::send::sda_norevers β€” Reverse off.
  • ::term::ansi::send::sda_nohidden β€” Hidden off.
  • ::term::ansi::send::sda_nostrike β€” Strike-through off.
  • ::term::ansi::send::sda_reset β€” Reset all attributes to their default values.
  • ::term::ansi::send::fcp row col β€” Force Cursor Position (aka Go To).
  • ::term::ansi::send::cu ?n? β€” Cursor Up. n defaults to 1.
  • ::term::ansi::send::cd ?n? β€” Cursor Down. n defaults to 1.
  • ::term::ansi::send::cf ?n? β€” Cursor Forward. n defaults to 1.
  • ::term::ansi::send::cb ?n? β€” Cursor Backward. n defaults to 1.
  • ::term::ansi::send::ss ?s e? β€” Scroll Screen (entire display, or between rows start end, inclusive).
  • ::term::ansi::send::skd code str β€” Set Key Definition.
  • ::term::ansi::send::title str β€” Set the terminal title.
  • ::term::ansi::send::gron β€” Switch to character/box graphics. I.e. switch to the alternate font.
  • ::term::ansi::send::groff β€” Switch to regular characters. I.e. switch to the default font.
  • ::term::ansi::send::tlc β€” Character graphics, Top Left Corner.
  • ::term::ansi::send::trc β€” Character graphics, Top Right Corner.
  • ::term::ansi::send::brc β€” Character graphics, Bottom Right Corner.
  • ::term::ansi::send::blc β€” Character graphics, Bottom Left Corner.
  • ::term::ansi::send::ltj β€” Character graphics, Left T Junction.
  • ::term::ansi::send::ttj β€” Character graphics, Top T Junction.
  • ::term::ansi::send::rtj β€” Character graphics, Right T Junction.
  • ::term::ansi::send::btj β€” Character graphics, Bottom T Junction.
  • ::term::ansi::send::fwj β€” Character graphics, Four-Way Junction.
  • ::term::ansi::send::hl β€” Character graphics, Horizontal Line.
  • ::term::ansi::send::vl β€” Character graphics, Vertical Line.
  • ::term::ansi::send::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 shifts which are not needed. To this end it also knows which characters will look the same in both modes, to handle strings created outside of this package. πŸ’…
  • ::term::ansi::send::clear β€” Clear screen. In essence a sequence of CursorHome + EraseDown.
  • ::term::ansi::send::init β€” Initialize default and alternate fonts to ASCII and box graphics.
  • ::term::ansi::send::showat row col text β€” Show the block of text at the specified location.

πŸ› BUGS, IDEAS, FEEDBACK πŸ’Œ

This document and the package it describes will undoubtedly contain bugs and other problems. Please report such in the category term of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. Please also report any ideas for enhancements you may have for either package and/or documentation. 🫢

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. πŸ’–


πŸ”‘ KEYWORDS πŸ”‘

  • character output
  • control
  • terminal

πŸ“¦ CATEGORY πŸ“¦

Terminal control


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


okay bestie, that's the whole page. This is tcllib 0.2, page term::ansi::send(3tcl). The footer didn't have a date, so no date energy today. Stay iconic. πŸ’…βœ¨

πŸ“¦ where this page comes from