From nobody Mon May 6 22:51:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1511860027141731.2780311539785; Tue, 28 Nov 2017 01:07:07 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1D633203564A9; Tue, 28 Nov 2017 01:02:43 -0800 (PST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AB2D221A1097C for ; Tue, 28 Nov 2017 01:02:42 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2017 01:07:04 -0800 Received: from unknown (HELO ray-dev.ccr.corp.intel.com) ([10.239.9.37]) by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2017 01:07:03 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,467,1505804400"; d="scan'208";a="7923163" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Tue, 28 Nov 2017 17:07:02 +0800 Message-Id: <20171128090702.63424-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.0.gvfs.1.preview.4 Subject: [edk2] [PATCH] ShellPkg: Fix the bug that handling Ctrl-C improperly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Current implementation resets the CTRL-C event early when printing the shell prompt, when user types "ls", "ls" command is terminated immediately when starts. It's not an expected behavior from users' perspective. Correct way is to reset the CTRL-C event just before running the command, which is a bit later than current point. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Jaben Carsey Reviewed-by: Jaben Carsey --- ShellPkg/Application/Shell/Shell.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shel= l/Shell.c index 2adc99240c..577e17311b 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -620,11 +620,6 @@ UefiMain ( ShellInfoObject.ConsoleInfo->Enabled =3D TRUE; ShellInfoObject.ConsoleInfo->RowCounter =3D 0; =20 - // - // Reset the CTRL-C event (yes we ignore the return values) - // - Status =3D gBS->CheckEvent (ShellInfoObject.NewEfiShellProtocol-= >ExecutionBreak); - // // Display Prompt // @@ -1346,9 +1341,14 @@ DoShellPrompt ( // Null terminate the string and parse it // if (!EFI_ERROR (Status)) { + // + // Reset the CTRL-C event just before running the command (yes we igno= re the return values) + // + Status =3D gBS->CheckEvent (ShellInfoObject.NewEfiShellProtocol->Execu= tionBreak); + CmdLine[BufferSize / sizeof (CHAR16)] =3D CHAR_NULL; Status =3D RunCommand(CmdLine); - } + } =20 // // Done with this command --=20 2.15.0.gvfs.1.preview.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel