term::ansi::code(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ 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 Tcl 8.5 or 9 in 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 either esc or escb. 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 (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