[//000000001]: # (term::ansi::code::ctrl \- Terminal control) [//000000002]: # (Generated from file 'ansi\_cctrl\.man' by tcllib/doctools with format 'markdown') [//000000003]: # (Copyright © 2006\-2008 Andreas Kupries ) [//000000004]: # (term::ansi::code::ctrl\(n\) 0\.3 tcllib "Terminal control")
[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]
# NAME term::ansi::code::ctrl \- ANSI control sequences # Table Of Contents - [Table Of Contents](#toc) - [Synopsis](#synopsis) - [Description](#section1) - [API](#section2) - [Introspection](#subsection1) - [Sequences](#subsection2) - [Bugs, Ideas, Feedback](#section3) - [Keywords](#keywords) - [Category](#category) - [Copyright](#copyright) # SYNOPSIS package require Tcl 8\.4 package require term::ansi::code ?0\.2? package require term::ansi::code::ctrl ?0\.3? [__::term::ansi::code::ctrl::names__](#1) [__::term::ansi::code::ctrl::import__ ?*ns*? ?*arg*\.\.\.?](#2) [__::term::ansi::code::ctrl::eeol__](#3) [__::term::ansi::code::ctrl::esol__](#4) [__::term::ansi::code::ctrl::el__](#5) [__::term::ansi::code::ctrl::ed__](#6) [__::term::ansi::code::ctrl::eu__](#7) [__::term::ansi::code::ctrl::es__](#8) [__::term::ansi::code::ctrl::sd__](#9) [__::term::ansi::code::ctrl::su__](#10) [__::term::ansi::code::ctrl::ch__](#11) [__::term::ansi::code::ctrl::sc__](#12) [__::term::ansi::code::ctrl::rc__](#13) [__::term::ansi::code::ctrl::sca__](#14) [__::term::ansi::code::ctrl::rca__](#15) [__::term::ansi::code::ctrl::st__](#16) [__::term::ansi::code::ctrl::ct__](#17) [__::term::ansi::code::ctrl::cat__](#18) [__::term::ansi::code::ctrl::qdc__](#19) [__::term::ansi::code::ctrl::qds__](#20) [__::term::ansi::code::ctrl::qcp__](#21) [__::term::ansi::code::ctrl::rd__](#22) [__::term::ansi::code::ctrl::elw__](#23) [__::term::ansi::code::ctrl::dlw__](#24) [__::term::ansi::code::ctrl::eg__](#25) [__::term::ansi::code::ctrl::lg__](#26) [__::term::ansi::code::ctrl::scs0__ *tag*](#27) [__::term::ansi::code::ctrl::scs1__ *tag*](#28) [__::term::ansi::code::ctrl::sda__ *arg*\.\.\.](#29) [__::term::ansi::code::ctrl::sda\_fgblack__](#30) [__::term::ansi::code::ctrl::sda\_fgred__](#31) [__::term::ansi::code::ctrl::sda\_fggreen__](#32) [__::term::ansi::code::ctrl::sda\_fgyellow__](#33) [__::term::ansi::code::ctrl::sda\_fgblue__](#34) [__::term::ansi::code::ctrl::sda\_fgmagenta__](#35) [__::term::ansi::code::ctrl::sda\_fgcyan__](#36) [__::term::ansi::code::ctrl::sda\_fgwhite__](#37) [__::term::ansi::code::ctrl::sda\_fgdefault__](#38) [__::term::ansi::code::ctrl::sda\_bgblack__](#39) [__::term::ansi::code::ctrl::sda\_bgred__](#40) [__::term::ansi::code::ctrl::sda\_bggreen__](#41) [__::term::ansi::code::ctrl::sda\_bgyellow__](#42) [__::term::ansi::code::ctrl::sda\_bgblue__](#43) [__::term::ansi::code::ctrl::sda\_bgmagenta__](#44) [__::term::ansi::code::ctrl::sda\_bgcyan__](#45) [__::term::ansi::code::ctrl::sda\_bgwhite__](#46) [__::term::ansi::code::ctrl::sda\_bgdefault__](#47) [__::term::ansi::code::ctrl::sda\_bold__](#48) [__::term::ansi::code::ctrl::sda\_dim__](#49) [__::term::ansi::code::ctrl::sda\_italic__](#50) [__::term::ansi::code::ctrl::sda\_underline__](#51) [__::term::ansi::code::ctrl::sda\_blink__](#52) [__::term::ansi::code::ctrl::sda\_revers__](#53) [__::term::ansi::code::ctrl::sda\_hidden__](#54) [__::term::ansi::code::ctrl::sda\_strike__](#55) [__::term::ansi::code::ctrl::sda\_nobold__](#56) [__::term::ansi::code::ctrl::sda\_noitalic__](#57) [__::term::ansi::code::ctrl::sda\_nounderline__](#58) [__::term::ansi::code::ctrl::sda\_noblink__](#59) [__::term::ansi::code::ctrl::sda\_norevers__](#60) [__::term::ansi::code::ctrl::sda\_nohidden__](#61) [__::term::ansi::code::ctrl::sda\_nostrike__](#62) [__::term::ansi::code::ctrl::sda\_reset__](#63) [__::term::ansi::send::fcp__ *row* *col*](#64) [__::term::ansi::code::ctrl::cu__ ?*n*?](#65) [__::term::ansi::code::ctrl::cd__ ?*n*?](#66) [__::term::ansi::code::ctrl::cf__ ?*n*?](#67) [__::term::ansi::code::ctrl::cb__ ?*n*?](#68) [__::term::ansi::code::ctrl::ss__ ?*s* *e*?](#69) [__::term::ansi::code::ctrl::skd__ *code* *str*](#70) [__::term::ansi::code::ctrl::title__ *str*](#71) [__::term::ansi::code::ctrl::gron__](#72) [__::term::ansi::code::ctrl::groff__](#73) [__::term::ansi::code::ctrl::tlc__](#74) [__::term::ansi::code::ctrl::trc__](#75) [__::term::ansi::code::ctrl::brc__](#76) [__::term::ansi::code::ctrl::blc__](#77) [__::term::ansi::code::ctrl::ltj__](#78) [__::term::ansi::code::ctrl::ttj__](#79) [__::term::ansi::code::ctrl::rtj__](#80) [__::term::ansi::code::ctrl::btj__](#81) [__::term::ansi::code::ctrl::fwj__](#82) [__::term::ansi::code::ctrl::hl__](#83) [__::term::ansi::code::ctrl::vl__](#84) [__::term::ansi::code::ctrl::groptim__ *str*](#85) [__::term::ansi::code::ctrl::clear__](#86) [__::term::ansi::code::ctrl::init__](#87) [__::term::ansi::code::ctrl::showat__ *row* *col* *text*](#88) # DESCRIPTION This package provides symbolic names for the ANSI control sequences\. For each sequence a single command is provided which returns the sequence as its result\. None of the commands of this package write to a channel; that is handled by higher level packages, like __[term::ansi::send](ansi\_send\.md)__\. # API ## Introspection - __::term::ansi::code::ctrl::names__ This command is for introspection\. It returns as its result a list containing the names of all attribute commands\. - __::term::ansi::code::ctrl::import__ ?*ns*? ?*arg*\.\.\.? This command imports some or all attribute commands into the namespace *ns*\. This is by default the namespace *ctrl*\. Note that this is relative namespace name, placing the imported command into a child of the current namespace\. By default all commands are imported, this can howver be restricted by listing the names of the wanted commands 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\. Choose which character set is used for either default \(scs0\) or alternate font \(scs1\)\. This does not change whether default or alternate font are used, only their definition\. 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](ansi\_cattr\.md)__\. For convenience this package also provides additional commands each setting a single specific attribute\. - __::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 to 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::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 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](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 [ansi](\.\./\.\./\.\./\.\./index\.md\#ansi), [attribute control](\.\./\.\./\.\./\.\./index\.md\#attribute\_control), [color control](\.\./\.\./\.\./\.\./index\.md\#color\_control), [control](\.\./\.\./\.\./\.\./index\.md\#control), [terminal](\.\./\.\./\.\./\.\./index\.md\#terminal) # CATEGORY Terminal control # COPYRIGHT Copyright © 2006\-2008 Andreas Kupries