diff options
author | Jaben Carsey <jaben.carsey@intel.com> | 2013-12-09 22:55:13 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-12-09 22:55:13 +0000 |
commit | 194ae48daebe53555cdfbaa75235fbf9e830b79d (patch) | |
tree | 63c22a9344fb12f24e7c6a34a8493f5690ca077d | |
parent | 0f83ac340fef4972b1542d29613a90230695749b (diff) | |
download | edk2-platforms-194ae48daebe53555cdfbaa75235fbf9e830b79d.tar.xz |
ShellPkg: Add support for CTRL-C within shell user prompting
This allows for the user to get out of answering a question with CTRL-C
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14950 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 40b87fec34..7b34aff2f8 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -3296,6 +3296,10 @@ ShellPromptForResponse ( //
*Resp = ShellPromptResponseMax;
while (*Resp == ShellPromptResponseMax) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
ASSERT_EFI_ERROR(Status);
@@ -3324,6 +3328,10 @@ ShellPromptForResponse ( //
*Resp = ShellPromptResponseMax;
while (*Resp == ShellPromptResponseMax) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
ASSERT_EFI_ERROR(Status);
@@ -3358,6 +3366,10 @@ ShellPromptForResponse ( //
*Resp = ShellPromptResponseMax;
while (*Resp == ShellPromptResponseMax) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
if (Type == ShellPromptResponseTypeEnterContinue) {
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
@@ -3385,6 +3397,10 @@ ShellPromptForResponse ( //
*Resp = ShellPromptResponseMax;
while (*Resp == ShellPromptResponseMax) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
ASSERT_EFI_ERROR(Status);
@@ -3406,6 +3422,10 @@ ShellPromptForResponse ( ShellPrintEx(-1, -1, L"%s", Prompt);
}
while(1) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
ASSERT_EFI_ERROR(Status);
@@ -3419,6 +3439,7 @@ ShellPromptForResponse ( break;
//
// This is the location to add new prompt types.
+ // If your new type loops remember to add ExecutionBreak support.
//
default:
ASSERT(FALSE);
|