3 ms·
Happy was the day I gave up on curses and just started splatting crap at the terminal with my own control codes. For too long did I think that curses was the o
by gorgoiler 5y ago
Happy was the day I gave up on curses and just started splatting crap at the terminal with my own control codes.
For too long did I think that curses was the one and only way to do anything with a terminal.
- slicktux 5y agoCare to elaborate on the control codes over curses? I’m curious :]
- shakna 5y agoI 'maintain' a shell script/library that can do a lot of the basic things like color controls, control getch, move the screen cursor, etc. [0] Taking a peek under covers to see how easy it is. A couple printfs from whatever language is way way less overhead than bundling in the whole of curses. [0] https://git.sr.ht/~shakna/damned https://git.sr.ht/~shakna/damned
- gorgoiler 5y agoAt its simplest, manage screen state yourself and redraw it by moving the cursor and colouring with ANSI codes: https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797 https://gist.github.com/fnky/458719343aabd01cfb17a3a4f729679... Turning the cursor on and off, 24 bit color, etc. A lot is possible though you potential sacrifice portability (which in 2021 translates to “don’t expect your stuff to render properly if your at the Linux console, and everywhere else it is fine.”)
- akkartik 5y agoYes, it's unquestionably always good to know how things work.