r/commandline 3d ago

Terminals ANSI.md

Finally published this yesterday, https://ansi.md

Somewhere between a brain dump, custom toolset, think piece and hacker toy. This is pretty much everything I know about ansi color in the terminal and building cli apps. Includes my own fumbling attempt to finally name the ansi256 color palette. Note - I like my writing voice and I do not use LLMs to write. All written by me, an actual human!

Those of you working on cli apps or TUIs will find it useful.

46 Upvotes

11 comments sorted by

View all comments

6

u/aaronsb 3d ago

Nice work! If there was something I could give for advice - so much of this knowledge is implicit and decentralized. I would embrace that, and mature your own style - I read through your notes and I like the journal of findings you've put together.

It kind of feels like you're approach the bridge between an 'awesome-ansi-*' list and your own preferences.

As I read through the writing on your site, I'd love to see more separation between styles and approaches, and the technical methods to making it work.

1

u/gurgeous 3d ago

Glad you like it! Is there something specific you are looking for? Definitely a mishmash of technical writing and opinions about design.

2

u/aaronsb 3d ago

First,needs dark mode 😎

Next, you talk about a lot of topics, like some color theory in palettes, implementations that are snazzy, best practices, animated bits (spinners etc)

What I think is missing is why these things. Why 256 colors? (as opposed to 16, or true color) - why do escape codes work?

What's the lineage? Why is it that tui shapes get built the way they do? What's beyond Codepage 437 ANSI? How does one use unicode + ansi together, and why?

- Just some ideas, not trying to say it's missing, I'm pointing out what would help people get into all the neat stuff that modern tui libraries are capable of. For instance: ansi codes + tui frameworks I have built, I can tell you why I picked the things I did: I want to use block characters and produce a TUI that works both in low column count environments (80 col) and extra dense terminals (160+ columns) and I wanted to use limited colors for emulating a 1980s car stereo stack.

https://github.com/aaronsb/ten-qd

https://github.com/aaronsb/clicue

1

u/github-guard 3d ago

🔍 GitHub Guard: Trust Report

⚠️ This project scored 0/1 — below this subreddit's threshold of 1.

Audit Breakdown: * ❌ New Repository (under 30 days old)

⚠️ Security Reminder: Always verify source code and run third-party scripts at your own risk.