From patchwork Mon Aug 28 15:41:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 9925823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8A4B60311 for ; Mon, 28 Aug 2017 15:42:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BDFA28714 for ; Mon, 28 Aug 2017 15:42:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90D0628717; Mon, 28 Aug 2017 15:42:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8AD912871B for ; Mon, 28 Aug 2017 15:42:36 +0000 (UTC) Received: from localhost ([::1]:40300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmMBP-0002M0-Bj for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Aug 2017 11:42:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmMAo-0002Lq-R0 for qemu-devel@nongnu.org; Mon, 28 Aug 2017 11:41:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmMAj-0007sf-Vv for qemu-devel@nongnu.org; Mon, 28 Aug 2017 11:41:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:56268 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dmMAj-0007sQ-Ot for qemu-devel@nongnu.org; Mon, 28 Aug 2017 11:41:53 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B1AEEAC6C; Mon, 28 Aug 2017 15:41:52 +0000 (UTC) From: Alexander Graf To: qemu-devel@nongnu.org Date: Mon, 28 Aug 2017 17:41:52 +0200 Message-Id: <20170828154152.15778-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 Subject: [Qemu-devel] [PATCH v3] console: add question-mark escape operator X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some termcaps (found using SLES11SP1) use [? sequences. According to man console_codes (http://linux.die.net/man/4/console_codes) the question mark is a nop and should simply be ignored. This patch does exactly that, rendering screen output readable when outputting guest serial consoles to the graphical console emulator. Signed-off-by: Alexander Graf --- v1 -> v2: - rebase to 2.10 v2 -> v3: - fix coding style issues --- ui/console.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/console.c b/ui/console.c index d2d3534c49..37fee92001 100644 --- a/ui/console.c +++ b/ui/console.c @@ -880,8 +880,9 @@ static void console_putchar(QemuConsole *s, int ch) } else { if (s->nb_esc_params < MAX_ESC_PARAMS) s->nb_esc_params++; - if (ch == ';') + if (ch == ';' || ch == '?') { break; + } trace_console_putchar_csi(s->esc_params[0], s->esc_params[1], ch, s->nb_esc_params); s->state = TTY_STATE_NORM;