From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org 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 EBF7C2211B413 for ; Tue, 28 Nov 2017 06:53:58 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2017 06:58:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,468,1505804400"; d="scan'208";a="12926787" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 28 Nov 2017 06:58:21 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 28 Nov 2017 06:58:21 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.117]) by FMSMSX112.amr.corp.intel.com ([169.254.5.121]) with mapi id 14.03.0319.002; Tue, 28 Nov 2017 06:58:20 -0800 From: "Carsey, Jaben" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] ShellPkg: Fix the bug that handling Ctrl-C improperly Thread-Index: AQHTaChH3JahtG7NjkyCEOdHoGJDhqMp4lPQ Date: Tue, 28 Nov 2017 14:58:20 +0000 Message-ID: References: <20171128090702.63424-1-ruiyu.ni@intel.com> In-Reply-To: <20171128090702.63424-1-ruiyu.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWVmNmRiNDEtNjY1OC00YjljLTgyZjMtMWNlNGMyMGUzZDhkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ing1WDEzTXpERXZ6eUE2MHViTGh4UHpVSzJHd0M5dDN2Tks2M2QxYmJJVTA9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Tue, 28 Nov 2017 14:53:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: Ni, Ruiyu > Sent: Tuesday, November 28, 2017 1:07 AM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben > Subject: [PATCH] ShellPkg: Fix the bug that handling Ctrl-C improperly > Importance: High >=20 > 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. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ruiyu Ni > Cc: Jaben Carsey > --- > ShellPkg/Application/Shell/Shell.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/ShellPkg/Application/Shell/Shell.c > b/ShellPkg/Application/Shell/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.NewEfiShellProtoco= l- > >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 > ignore the return values) > + // > + Status =3D gBS->CheckEvent (ShellInfoObject.NewEfiShellProtocol- > >ExecutionBreak); > + > CmdLine[BufferSize / sizeof (CHAR16)] =3D CHAR_NULL; > Status =3D RunCommand(CmdLine); > - } > + } >=20 > // > // Done with this command > -- > 2.15.0.gvfs.1.preview.4