I don’t believe I could do better than curses/ncurses. What I do believe, however, is that replicating the work isn’t always bloat. If you’re only going to use a small subset of the library anyway, replicating a bit of it might actually be less bloaty than including the whole thing. That said, when in doubt using pre-made solutions surely is better _if_ you’re working in a professional/production-grade environment. I on the other hand am just playing around and seeing how far I can take this.
Projects like these are always welcome on Hacker News. I am saddened to see comments like the parent's (that are too eager to discourage any technical decision that does not conform to their opinion) popping up in this community often.
The very purpose of the "Show HN" prefix is to show off fun projects like these to the HN community and the more such projects we have (regardless of what technical decisions were taken to create the project), the better it serves that purpose.
> Part of what curses does is optimize cursor control sequences so (for example) to backspace all the way to the beginning of a line, instead of writing out a bunch of back-space characters, it can issue one command to move the cursor to the beginning of the line, and one more to erase to the end of the line.
For more detail, there's the source code.
I don't have my code handy right now but all the screen handling amounts to maybe a couple hundred lines of code, out of many thousand.