From: Rob Landley <rob@landley.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] handling SIGWINCH with qemu -nographic
Date: Fri, 19 Oct 2007 19:22:04 -0500 [thread overview]
Message-ID: <200710191922.04587.rob@landley.net> (raw)
In-Reply-To: <471410B1.3030703@gmail.com>
On Monday 15 October 2007 8:15:29 pm Jeff Carr wrote:
> Has anyone looked into finding a way to pass SIGWINCH through to the
> guest? I started looking at linux-user/signal.c.
>
> For those that might not be familiar with SIGWINCH, supporting it
> would allow qemu -nographic to tell when the terminal is a different
> size than 80x24.
The problem is a serial port is essentially a pipe. You don't get tty
information about the terminal plugged into the other side, because that's a
separate machine on the other side of a piece of hardware which doesn't pass
through that info. (What _is_ the width and height of a modem?)
Have your program send an ansi probe sequence:
echo -e "\e[s\e[999C\e[999B\e[6n\e[u"
Then parse the return string, which should look something like escape left
bracket 25 semicolon 80 capital R, and use it to set $LINES=25 and
$COLUMNS=80.
Any modern terminal program should handle that and spit back a result telling
you big the tty is (although it doesn't tell you when it _changes_, you have
to re-probe). Yes, it's in-band signalling but over a serial connection
that's all you've got.
Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
prev parent reply other threads:[~2007-10-20 3:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-16 1:15 [Qemu-devel] handling SIGWINCH with qemu -nographic Jeff Carr
2007-10-16 2:32 ` Paul Brook
2007-10-16 18:21 ` Jeff Carr
2007-10-16 20:51 ` Stefan Weil
2007-10-16 21:21 ` Paul Brook
2007-10-20 0:24 ` Rob Landley
2007-10-16 14:04 ` Stuart Brady
2007-10-20 0:22 ` Rob Landley [this message]
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=200710191922.04587.rob@landley.net \
--to=rob@landley.net \
--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).