My knowledge on terminal emulators is a little sketchy, and in an effort to learn more about them, I thought I could experiment with some of the escape sequences and see what I can do. One of the things I thought of to try was (pseudo-code):
pushTerminalState()
writeSomeDataToTheScreen()
popTerminalStateToRestoreItToTheWayItWasBefore()
In researching how to do this, I came across two control functions
However, I am unsure how to use them. For the DECTSR function I am trying process.stdout.write('\x1B1$u')
. According to the note on the DECTSR page, this should give a "response", but I am unaware as to where I should "read" the response from? I naively attempted to read from STDIN, but as expected I only received keys from my terminal.
Any tips on what I am doing wrong?