|
From: | Lennart Jablonka |
Subject: | Re: [PATCH] [grotty]: Use terminfo. |
Date: | Mon, 21 Aug 2023 21:45:51 +0000 |
Quoth Lennart Jablonka:
I _don't_ want to refactor grotty(1), as a single program, to support being built with or without terminfo. That way lies a rope bridge over a chasm belching flames hundreds of feet into the air, and its name is dlopen(). (Portability problems are what scare me.)If we need to keep a terminfo-free output driver around, then I'd rather keep grotty more or less as-is and do this work in a new terminfo-enhanced TTY driver. "grotitty" or something. Shared routines could of course be moved into a common.cpp file.I don’t see where you’d consider using dlopen here, but otherwise mostly agree. Though then I’d still drop SGR and have a more or less clean split between overstriking and terminfo.
Actually, no. Overstriking is a sensible thing to do for a terminfo program being presented with a terminal declaring the “os” capability. I don’t want two grottys.
// many terminals can't handle 'CSI 39 m' and 'CSI 49 m' to reset // the foreground and background color, respectively; we thus use // 'CSI 0 m' exclusively -#define SGR_DEFAULT CSI "0m" +static const char *sgr_exit_attributes = CSI "0m";Mmmm. I don't like hiding other people's bugs. With respect to terminal emulators in particular, though, doing so seems to have been a popular thing, and it may be one of the reasons terminal emulators have tended to suck in some respects. They're often brilliant at stuff like alpha-blended color gradients and URL tooltip pop-ups, but completely defecate themselves when it comes to basic matters of competency like VT100 emulation. Kinda tempted to revert this 0m hack (in a separate commit) and see what happens.I agree. Terminfo has the capability op for resetting colors, if I understand it correctly.
Actually, only if we get capabilities for disabling the other attributes we need as well. Unless we can disable everything separately, it doesn’t make much sense to disable anything separately.
[Prev in Thread] | Current Thread | [Next in Thread] |