From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8Fhh-000879-I2 for qemu-devel@nongnu.org; Mon, 05 Jan 2015 17:00:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8Fhe-0006ps-Ah for qemu-devel@nongnu.org; Mon, 05 Jan 2015 17:00:49 -0500 Received: from indium.canonical.com ([91.189.90.7]:40869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8Fhe-0006pl-4r for qemu-devel@nongnu.org; Mon, 05 Jan 2015 17:00:46 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1Y8Fhc-0005fc-TE for ; Mon, 05 Jan 2015 22:00:44 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id C2B3F2E80C8 for ; Mon, 5 Jan 2015 22:00:44 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Mon, 05 Jan 2015 21:54:24 -0000 From: Nadav Har'El Sender: bounces@canonical.com References: <20150105215424.22410.18753.malonedeb@gac.canonical.com> Message-Id: <20150105215424.22410.18753.malonedeb@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1407808] [NEW] virtual console gives strange response to ANSI DSR Reply-To: Bug 1407808 <1407808@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Public bug reported: With "-serial vc" (which is the default), qemu make strange responses to the ANSI DSR escape sequence (\033[6n) which can confuse guests. Terminal emulators supporting the ANSI escape sequences usually support the "Device Status Report" escape sequence, \033[6n, to which as a response the terminal injects as input the response \033[n;mR, containing the current cursor position. An application running in the guest can use this escape sequence to, for example, figure out the size of the terminal it is running under, which can be useful as the guest has no other standard way to figure out a "size" for the serial port. Unfortunately, it seems that qemu when run with "-serial vc" (which appears to be the default), when qemu gets the \033[6n escape sequence on the serial port, it just responds with a single \033, and that's it! This can confuse an application, could concievably assume that a terminal either supports this escape sequence and injects the correct response (\033[n;mR), or doesn't support it and injects absolutely nothing as input - but not something in between. This caused a problem on one shell implementation on OSv that tried to figure out the terminal's size, and had to work around this unexpected behavior (see https://github.com/cloudius- systems/osv/commit/b79223584be40459861d1c12e1cb67e3e49e2a12). ** Affects: qemu Importance: Undecided Status: New -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1407808 Title: virtual console gives strange response to ANSI DSR Status in QEMU: New Bug description: With "-serial vc" (which is the default), qemu make strange responses to the ANSI DSR escape sequence (\033[6n) which can confuse guests. Terminal emulators supporting the ANSI escape sequences usually support the "Device Status Report" escape sequence, \033[6n, to which as a response the terminal injects as input the response \033[n;mR, containing the current cursor position. An application running in the guest can use this escape sequence to, for example, figure out the size of the terminal it is running under, which can be useful as the guest has no other standard way to figure out a "size" for the serial port. Unfortunately, it seems that qemu when run with "-serial vc" (which appears to be the default), when qemu gets the \033[6n escape sequence on the serial port, it just responds with a single \033, and that's it! This can confuse an application, could concievably assume that a terminal either supports this escape sequence and injects the correct response (\033[n;mR), or doesn't support it and injects absolutely nothing as input - but not something in between. This caused a problem on one shell implementation on OSv that tried to figure out the terminal's size, and had to work around this unexpected behavior (see https://github.com/cloudius- systems/osv/commit/b79223584be40459861d1c12e1cb67e3e49e2a12). To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1407808/+subscriptions