Hi all
I'm in the process of building a new terminal emulator. Yes, I know they're already a dime a dozen but I have plans to take this into a different direction.
Anyhow, the big problem I have is that there are literally hundreds of escape codes that you need to support even just to reach parity with xterm. And while I've been trawling through xterm's docs (eg https://www.xfree86.org/current/ctlseqs.html ) they don't really go into much detail regarding how the actual implementation should look like.
for example: CSI n S (Scroll Up), should that insert empty lines at the bottom (ie scrolling the content up) or scroll back through the buffer?
Admittedly a lot of the codes are pretty self-explanatory and I can fill in a lot of missing gaps via testing those escape codes in other terminal emulators. But having a detailed reference doc would certainly save a lot of time (and reduce the risk of error too).
To be clear, what I'm looking for is a more exhaustive list of escape codes rather than the common ones everyone already knows like SGR.
Thanks in advance :)
That being said:
> for example: CSI n S (Scroll Up), should that insert empty lines at the bottom (ie scrolling the content up) or scroll back through the buffer?
As a general rule, nothing interacts with scrollback. CSI S inserts empty lines at the bottom of the screen and deletes lines from the top; conversely, CSI T inserts empty lines at the top and deletes from the bottom.
Which operations should touch the scrollback is debatable. My inclination is to only append to scrollback when scrolling occurs "naturally" as the result of a newline or wrap, and neither DECSTBM nor the alternate screen are active at the time. (DECSTBM and alt-screen tend to indicate that a full-screen application is running, so saving rows to scrollback is unlikely to be meaningful.)