term::ansi::code(n)
β¨ NAME β¨
term::ansi::code β your lil helper bestie for control sequences π
Like, it's part of tcllib's Terminal control corner of the world, and it exists so you don't have to hand-stitch ANSI escape codes like some kind of Victorian orphan. It's giving convenience, it's giving define your own sequences, no cap.
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require term::ansi::code ?0.2?
::term::ansi::code::esc str
::term::ansi::code::escb str
::term::ansi::code::define name escape code
::term::ansi::code::const name code
ok so real talk: you need Tcl8.5or9in the house, and the package itself is version?0.2?π«Ά
π DESCRIPTION π
Bestie. This package hands you commands that let you define control sequences in an easy manner. That's the whole vibe. Terminal go brrr, but politely. π
::term::ansi::code::esc strβ hands you back the argument string, but prefixed with the ANSI escape character,"\033."β¨ It's literally just str with a little escape hat on. Iconic.::term::ansi::code::escb strβ same energy, different prefix: it returns the argument string prefixed with the common ANSI escape sequence,"\033["π That bracket is doing so much heavy lifting, I'm obsessed.::term::ansi::code::define name escape codeβ this one creates a procedure called name, and that procedure returns the control sequence code, beginning with the specified escape sequence β which is eitherescorescb. So you're basically manifesting your own little sequence-generator and naming it. main character energy fr fr π::term::ansi::code::const name codeβ also defines a procedure called name, and that procedure returns the control sequence code. No escape sequence prefix, no drama, just the code. Lowkey the chillest one of the group. π¦
π BUGS, IDEAS, FEEDBACK π
Not to be that girl, but this document and the package it describes will undoubtedly contain bugs and other problems. Like, obviously. It's software. π
So if you find one, please report it in the category term of the Tcllib Trackers:
http://core.tcl.tk/tcllib/reportlist
And if you have ideas for enhancements for either the package and/or the documentation β bring those too, we love a brainstorm π«Άβ¨
When you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. Do not freestyle it, bestie, the maintainers need the diff.
Also, heads up: attachments are strongly preferred over inlined patches. π
How do you attach? Go to the Edit form of the ticket immediately after its creation, then use the left-most button in the secondary navigation bar. That's the whole quest. You got this. π
π KEYWORDS π
control, declare, define, terminal
π§ CATEGORY π§
Terminal control
π COPYRIGHT π
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
ok that's the whole page, you ate it, periodt π β¨
this was tcllib, version 0.2, and yeah the page is literally called term::ansi::code(n) β go forth and define your sequences, bestie, I'm so proud of you π«Άππ¦
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- 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