TICKIT_TERM_CHPEN(3)

πŸ’– TICKIT_TERM_CHPEN πŸ’–

okay bestie, welcome to the Library Functions Manual corner of the tickit cinematic universe πŸŽ€ this one's about the two functions that decide what your terminal text looks like β€” the whole tickit_term_chpen and tickit_term_setpen situation. yes they're sisters. no they are NOT the same. let's get into it πŸ’…


✨ NAME ✨

tickit_term_chpen, tickit_term_setpen β€” set the rendering attributes of the terminal πŸ¦‹


✨ SYNOPSIS ✨

#include <tickit.h>

void tickit_term_chpen(TickitTerm *tt, TickitPen *pen);
void tickit_term_setpen(TickitTerm *tt, TickitPen *pen);

Link with -ltickit.


✨ DESCRIPTION ✨

okay so picture this: your terminal has a whole vibe going on right now β€” colors, attributes, all of it. These two functions are how you change that vibe. The difference between them is literally the whole plot, so pay attention πŸ™ˆ

tickit_term_chpen() β€” the selective queen πŸ‘‘

tickit_term_chpen() changes the rendering attributes currently in effect in the terminal by setting those attributes specified in the given TickitPen instance. Attributes not present in pen stay exactly where they were β€” unmodified, untouched, living their best life. This operation does not bother them.

So like… you're only changing some of the things. The rest? Not invited to the makeover. πŸ’…

tickit_term_setpen() β€” the full reset, no survivors πŸ’€

tickit_term_setpen() changes the rendering attributes currently in effect in the terminal by setting all of the attributes to those given in the TickitPen instance. And here's the dramatic part: any attribute not present in pen gets reset back to its default value. Not "left alone". Not "gently preserved". Reset. Back to factory settings, bestie 😭

fr fr, this is the difference that will absolutely catch you off guard if you skim. chpen = patch the vibes. setpen = the vibes are now whatever you said they are, and anything you didn't mention is gone. choose wisely 🫢

the color downgrade moment 🌈

If the foreground or background colour is set to an index higher than the terminal can support, it will be converted to the best choice that is available from the palette of 8 or 16 colors. So you asked for the fancy color and the terminal said "bestie I only have 8 or 16, here's the closest match I can do" and honestly? It's doing its best and it ate ✨


✨ RETURN VALUE ✨

tickit_term_chpen() and tickit_term_setpen() return no value. They're void. They do the thing and they leave. No receipt, no follow-up text, no nothing. iconic behavior honestly πŸ‘‘


✨ SEE ALSO ✨


and that's the whole page, no cap 🧚 go forth and set your terminal's rendering attributes with intention, bestie. this has been TICKIT_TERM_CHPEN(3), part of the tickit library functions manual β€” mwah, take care of her πŸ’œπŸŒΈπŸ“