From patchwork Tue Aug 29 11:38:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 111210 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp6208837ybm; Tue, 29 Aug 2017 04:39:25 -0700 (PDT) X-Received: by 10.55.6.1 with SMTP id 1mr1660033qkg.177.1504006765576; Tue, 29 Aug 2017 04:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504006765; cv=none; d=google.com; s=arc-20160816; b=RhHdoYfURq+QU5pG2fP+BnBg0+jJmYY0/qwYm3xqaG737v2QZmVkNBf8VbgPuNnOCM WYj7CA8y2SrJT6T7Fr9HpLxTlezQj7DVlXpqZ+6sj8nRsg0l2oLiKrKPXqfC+KXbQuny 8Woe9YWKy1fIJvV1RS+i78StKeqUCxggyxoQxXDDvOsr8FcqrmjavXa5uLyp2vfX5hON hB84VYOzKYUjOMYv7AXduMkOkgfhR9pPIwyqTEzZyaCRRcBmgJ/tzovIZYD6BijDA97y JZpn8Dx2+84CfekvTWHCmvw18hq0/h/NJFPKSy7AWV71VoxFl3y69y0WOMtW1tPKLjJG pKlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :arc-authentication-results; bh=dCeV+7NCFFLFWlPBg5wLl+9DfV0ZEhor2MNXwnNU/wY=; b=0zd4WjYtJ023aOmSwQcuC9kz+bTDM5TrAB7ATFyMCCiHiCu/HpdDoBrXCy0Kx9TAyF uts32ktmuMGovwSyr6KR/SE3JCZyO0Agvi5rwU2gNMJeDvaG+Hkdf/z1RfqMiLR+u/AX Mn9QL4BG1CvzgiNVq9kGgFqoKS4YouPFb5fMdXoG5L6rzUmDenCem5c9dlpGjIHACmc5 4atl4lbpU+N6+lxFqwG8He7Kg5yAENsaSJ6H47ztjeCrpmNCIyCR45CGj5e92nWbdnuK XllHPx5I7omOG+UDXdrH7DmcyvzxrIZ5zuA6800+q/Y1qY0E6zTg0zqCubC4B314Ia0u psNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x4si2593343qkx.114.2017.08.29.04.39.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 29 Aug 2017 04:39:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:44261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmerb-0000n0-Ep for patch@linaro.org; Tue, 29 Aug 2017 07:39:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmeqf-0000Uj-Da for qemu-devel@nongnu.org; Tue, 29 Aug 2017 07:38:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmeqb-0001sq-D3 for qemu-devel@nongnu.org; Tue, 29 Aug 2017 07:38:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:52036 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 1dmeqb-0001sW-6d for qemu-devel@nongnu.org; Tue, 29 Aug 2017 07:38:21 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1780DAD9A; Tue, 29 Aug 2017 11:38:19 +0000 (UTC) From: Alexander Graf To: qemu-devel@nongnu.org Date: Tue, 29 Aug 2017 13:38:18 +0200 Message-Id: <20170829113818.42482-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.12.3 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;