Rough draft of DECRQSS implementation.#1
Conversation
|
Thanks for this. It looks pretty good at a glance. I will give it a proper look and test eventually. |
Adds orig_fgr and orig_sgr attributes for storing the original SGR color numbers that libtsm was correctly interpreting but not storing. Updates DECRQSS to report these correct numbers rather than libtsm's internal palette color numbers that fccode and bccode are set to.
|
Hi @diggernet, I recently updated this libtsm fork and finally got around to reviewing this. I've resolved some merge conflicts and made some small adjustments.
Right. When RGB colors are used
Your concern was correct! It turns out that Lines 1387 to 1389 in c477e0c This meant that setting the color to bright white ( In order to fix this, I've added two new attributes
libtsm supports SGR codes 30-127 for basic colors, plus full 256-color palette (0-255) and true color RGB, so I've update the range to < 256 to support this. The rest of the PR is great. I look forwards to adding these changes to the first GodotXterm Godot 4 asset library release which is almost ready to go! |
My C is pretty rusty, so I'm pretty sure that dcs_decrqss() is much clumsier than it should be. But you ought to be able to see what I'm going for. Improvements are welcome.
One obvious concern is that this won't work with RGB colors, because SGR wasn't designed for that.
Also, while I assume that fccode and bccode contain the SGR color numbers, I'm not 100% sure of that, and I don't know what range of values libtsm currently supports. This current code assumes they'll be 0-99, but the specs at invisible-island.net suggest that values over 100 are possible depending on implementation.