Building Reactive Terminal Interfaces in C++
hackernoon.com
hackernoon.com
I imagine that the choice was due to simplicity, as just changing "char" to "char32_t" does not completely solve the situation because of Unicode's combination characters. What one would need here is a "Pixel" structure capable to hold any Unicode grapheme, which unfortunately can be an arbitrary long sequence of bytes in any UTF8/16/32 encoding.
I am writing this because a few months ago I was trying to create some library similar to RxTerm and build a structure very similar to RxTerm's "Pixel", but got struck in inventing a smart way to keep a matrix of graphemes representing the state of the terminal screen. I gave up because the only idea I had was to use "std::string" within Pixel, and this didn't satisfy my taste.
Also, it seems that RxTerm does not use a terminfo database, but it just hardcodes ANSI escape sequences [2]. I understand that the concept of a terminfo database was invented when the number of incompatible terminals out there was far larger than today. How much widespread are today the escape sequences (cursor movements, color, font styles, etc.) used by libraries like RxTerm?
[1] https://github.com/LoopPerfect/rxterm/blob/master/rxterm/inc...
[2] https://github.com/LoopPerfect/rxterm/blob/master/rxterm/inc...