From: Roman Penyaev <r.peniaev@gmail.com>
Cc: "Roman Penyaev" <r.peniaev@gmail.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <20250226075913.353676-3-r.peniaev@gmail.com> (raw)
In-Reply-To: <20250226075913.353676-1-r.peniaev@gmail.com>
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
next prev parent reply other threads:[~2025-02-26 8:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 7:59 [PATCH v2 0/5] ui/console-vc: various fixes and improvements Roman Penyaev
2025-02-26 7:59 ` [PATCH v2 1/5] ui/console-vc: introduce parsing of the 'ESC ( <ch>' sequence Roman Penyaev
2025-02-26 7:59 ` Roman Penyaev [this message]
2025-02-26 7:59 ` [PATCH v2 3/5] ui/console-vc: report cursor position in the screen not in the scroll buffer Roman Penyaev
2025-02-26 7:59 ` [PATCH v2 4/5] ui/console-vc: add support for cursor DECSC and DECRC commands Roman Penyaev
2025-02-26 7:59 ` [PATCH v2 5/5] ui/console-vc: implement DCH (delete) and ICH (insert) commands Roman Penyaev
2025-02-26 10:06 ` [PATCH v2 0/5] ui/console-vc: various fixes and improvements Marc-André Lureau
2025-03-04 8:48 ` Roman Penyaev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250226075913.353676-3-r.peniaev@gmail.com \
--to=r.peniaev@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).