[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/5] ui/console-vc: report to the application instead of scree
From: |
Roman Penyaev |
Subject: |
[PATCH v2 2/5] ui/console-vc: report to the application instead of screen rendering |
Date: |
Wed, 26 Feb 2025 08:59:08 +0100 |
Terminal Device Status Report (DSR) [1] should be sent to an
application, not rendered to the screen. This patch fixes rendering of
terminal report, which appear only on the graphical screen of the
terminal (console "vc") and can be reproduced by the following
command:
echo -en '\e[6n'; IFS='[;' read -sdR _ row col; echo $row:$col
Command requests cursor position and waits for terminal response, but
instead, the response is rendered to the graphical screen and never
sent to an application.
Why bother? Busybox shell (ash) in Alpine distribution requests cursor
position on each shell prompt (once <ENTER> is pressed), which makes a
prompt on a graphical screen corrupted with repeating Cursor Position
Report (CPR) [2]:
[root@alpine ~]# \033[57;1R]
Which is very annoying and incorrect.
[1] https://vt100.net/docs/vt100-ug/chapter3.html#DSR
[2] https://vt100.net/docs/vt100-ug/chapter3.html#CPR
Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org
---
ui/console-vc.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/ui/console-vc.c b/ui/console-vc.c
index 90ff0ffda8c5..d512f57e10a9 100644
--- a/ui/console-vc.c
+++ b/ui/console-vc.c
@@ -617,10 +617,9 @@ static void vc_put_one(VCChardev *vc, int ch)
static void vc_respond_str(VCChardev *vc, const char *buf)
{
- while (*buf) {
- vc_put_one(vc, *buf);
- buf++;
- }
+ QemuTextConsole *s = vc->console;
+
+ qemu_chr_be_write(s->chr, (const uint8_t *)buf, strlen(buf));
}
/* set cursor, checking bounds */
--
2.43.0
- [PATCH v2 0/5] ui/console-vc: various fixes and improvements, Roman Penyaev, 2025/02/26
- [PATCH v2 2/5] ui/console-vc: report to the application instead of screen rendering,
Roman Penyaev <=
- [PATCH v2 3/5] ui/console-vc: report cursor position in the screen not in the scroll buffer, Roman Penyaev, 2025/02/26
- [PATCH v2 4/5] ui/console-vc: add support for cursor DECSC and DECRC commands, Roman Penyaev, 2025/02/26
- [PATCH v2 1/5] ui/console-vc: introduce parsing of the 'ESC ( <ch>' sequence, Roman Penyaev, 2025/02/26
- [PATCH v2 5/5] ui/console-vc: implement DCH (delete) and ICH (insert) commands, Roman Penyaev, 2025/02/26
- Re: [PATCH v2 0/5] ui/console-vc: various fixes and improvements, Marc-André Lureau, 2025/02/26