I started to write a terminal text editor, something like the first text editors for UNIX, such as vi. My only goal is to have a good time, but I want to be able to show text in color, so I can have syntax highlighting for editing source code.
How can I achieve this? Is there some special POSIX API for this, or do I have to use ncurses? (I’d rather not)
Any advice? Maybe some textbooks on the UNIX API?
This is a little C program that illustrates how you could use color codes: