From patchwork Thu May 7 23:33:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 48137 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1E83120553 for ; Thu, 7 May 2015 23:33:47 +0000 (UTC) Received: by wgtl5 with SMTP id l5sf16926990wgt.1 for ; Thu, 07 May 2015 16:33:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:reply-to:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=yNIOLHjkDQSgEFs+g/BAyDFLsZaApwXYomdgKp4GAyk=; b=V32yuW/HZpNlutx6i71WeUyJ+1jTiE+2NmgJOaNpUI1FnhSRKWtcR2azjoQbGiKp4p IeWUnLnbtmgCB+nQFjGL7twFVqdimAo3pqTnbhDVCMnsYCC9rlMrvVdqekizaNrymP7l Y2J+21mzhGrQxi/mCp8jWnvWy19KcpkVS77vWnJ1mus1RYnF9IOcvZjaSdgd5BbsJ9+v nh6TXD6jc7kWfLU4Qq9b7vBSwz0i4CoGgLnzgvoEjZk65V+CI0CkcVQ+nON0axBXG7fq XFAHR9952DYKhx5Bqv+XEmtVHmCUPcPvMfOqRHeteekjDq64h8770bWgftgLIkcdFbcB 7aPA== X-Gm-Message-State: ALoCoQnbwmJSBvj6kJTlaVYiCpQLoOdrvA0CYkndlmxWDqCAxW84vz6Ijg3kNXgjK9qyuAbgpTCN X-Received: by 10.194.236.230 with SMTP id ux6mr528144wjc.5.1431041626457; Thu, 07 May 2015 16:33:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.239.130 with SMTP id vs2ls232189lac.97.gmail; Thu, 07 May 2015 16:33:46 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr730605lbc.41.1431041626288; Thu, 07 May 2015 16:33:46 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id dn11si2173878lac.122.2015.05.07.16.33.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 16:33:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbbzk7 with SMTP id zk7so42224671lbb.0 for ; Thu, 07 May 2015 16:33:45 -0700 (PDT) X-Received: by 10.152.36.2 with SMTP id m2mr756214laj.72.1431041625814; Thu, 07 May 2015 16:33:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp142764lbb; Thu, 7 May 2015 16:33:44 -0700 (PDT) X-Received: by 10.50.79.130 with SMTP id j2mr830982igx.17.1431041624238; Thu, 07 May 2015 16:33:44 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id t10si2851453icf.6.2015.05.07.16.33.43 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 07 May 2015 16:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YqVIJ-0002T1-U0; Thu, 07 May 2015 23:33:31 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YqVIJ-0002Sw-7u for edk2-devel@lists.sourceforge.net; Thu, 07 May 2015 23:33:31 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.192.175 as permitted sender) client-ip=209.85.192.175; envelope-from=roy.franz@linaro.org; helo=mail-pd0-f175.google.com; Received: from mail-pd0-f175.google.com ([209.85.192.175]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YqVII-0002lH-GK for edk2-devel@lists.sourceforge.net; Thu, 07 May 2015 23:33:31 +0000 Received: by pdea3 with SMTP id a3so54290121pde.3 for ; Thu, 07 May 2015 16:33:24 -0700 (PDT) X-Received: by 10.66.102.105 with SMTP id fn9mr1636214pab.141.1431041604813; Thu, 07 May 2015 16:33:24 -0700 (PDT) Received: from rfranz-i7.local (c-50-173-43-186.hsd1.ca.comcast.net. [50.173.43.186]) by mx.google.com with ESMTPSA id dp4sm894053pbb.82.2015.05.07.16.33.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 16:33:23 -0700 (PDT) From: Roy Franz To: edk2-devel@lists.sourceforge.net, linaro-uefi@lists.linaro.org, feng.tian@intel.com Date: Thu, 7 May 2015 16:33:14 -0700 Message-Id: <1431041594-29773-1-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.9.1 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1YqVII-0002lH-GK Subject: [edk2] [PATCH] Treat ASCII DEL (0x7f) as backspace X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Most Linux terminal emulators use ASCII 0x7f (^?) for backspace, rather than 0x08 (^H) since ^H is used by some programs for other purposes, such as help menus. This results in backspace not working in most Linux environments, particularly in emulated environments such as QEMU where telnet or xterm may be used to connect to the emulated UART. While in some cases this can be configured in the terminal emulator, it must be done on every connection, as if permently configured this will break all other uses of the terminal. This change causes both ASCII 0x08 and 0x7F to be treated as backspace. This provides a working backspace when tested with minicom, screen, telnet, and xterm under Linux. I also tested teraterm and hyperterm under Windows connecting via rs232, and saw no regressions. (The delete key doesn't work on hyperterm both before and after the change) This change removes the ASCII encoding for delete, however this did not cause regressions on any tested terminal emulators as they do not use the ASCII encoding for the delete key. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Roy Franz --- MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 4a008c9..c92d3d4 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -1212,6 +1212,14 @@ UnicodeToEfiKey ( switch (TerminalDevice->InputState) { case INPUT_STATE_DEFAULT: + switch (UnicodeChar) { + case 0x7f: + UnicodeChar = CHAR_BACKSPACE; + break; + default : + break; + } + break; case INPUT_STATE_ESC: