Restore cursor position and other state.
To save the state use save cursor
The primary and alternate screen have distinct save state.
The following state is restored:
If not save was done before values are reset to their hard reset values.
🛆 the current cursor position is not restored relative to the origin set via cursor origin. 🛆 Not restored:
🛈 Until xterm 335 in left and right margin restoring of the cursor position was broken. 🛈 TODO investigate if not restoring sgr_background has detectable consequences. Also if not using setExtended{BG,FG} has.
🛆 cursor position is stored absolute (not with regard to origin) 🛆 always unsets pending the wrap state. 🛆 restores modes insert mode, send-receive mode and reverse display colors
🛆 Does not restore G0 - G3. But stores current mapping of GL and GR. 🛈 Before version 22.04.0, did not restore state of mode cursor origin 🛆 cursor position is stored absolute (not with regard to origin) 🛆 Does not restore pending wrap state.
🛆 the current cursor position is not restored relative to the origin set via cursor origin. 🛆 Not restored: