ui/console-vc: add support for cursor DECSC and DECRC commands
authorRoman Penyaev <r.peniaev@gmail.com>
Wed, 26 Feb 2025 07:59:10 +0000 (08:59 +0100)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 5 Mar 2025 05:34:14 +0000 (09:34 +0400)
commit1a0fd7838a9dddf91241bc9faa471dc9dec04329
tree4d9d388ee6a7207d7b8c741867e50bcb3b150334
parent40339871da115b68e01f1da9ce2f8175e8f65d3c
ui/console-vc: add support for cursor DECSC and DECRC commands

There are aliases for save and restore cursor commands:

* save cursor
    `ESC 7`     (DEC Save Cursor [1], older VT100)
    `ESC [ s`   (CSI Save Cursor, standard ANSI)

* load cursor
    `ESC 8`     (DEC Restore Cursor [2], older VT100)
    `ESC [ u`   (CSI Restore Cursor, standard ANSI)

This change introduces older DEC sequencies for compatibility with
some scripts (for example [3]) and tools.

This change also adds saving and restoring of character attributes,
which is according to the VT spec [1][2]

[1] https://vt100.net/docs/vt510-rm/DECSC.html
[2] https://vt100.net/docs/vt510-rm/DECRC.html
[3] https://wiki.archlinux.org/title/Working_with_the_serial_console#Resizing_a_terminal

Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20250226075913.353676-5-r.peniaev@gmail.com>
ui/console-vc.c