summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-19 18:18:12 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2012-01-19 18:18:12 +0000
commitecfd71af17316deefd3cd4eaa305016b6678109b (patch)
treea0ead88d947d68f3656037648a45b21de98d6b4f /ShellPkg
parente9a9efb8e516bb5d96aa122da5e3c257f3c7b9cc (diff)
downloadedk2-platforms-ecfd71af17316deefd3cd4eaa305016b6678109b.tar.xz
ShellPkg: Fix SimpleTextInputEx based "CTRL-S" by emptying the buffer to prevent immediate release of the pause.
signed-off-by: jcarsey reviewed-by: leegrosenbaum git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12944 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
index 00bbc358fa..3371e58b11 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -2,7 +2,7 @@
Member functions of EFI_SHELL_PROTOCOL and functions for creation,
manipulation, and initialization of EFI_SHELL_PROTOCOL.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -3336,8 +3336,8 @@ NotificationFunction(
IN EFI_KEY_DATA *KeyData
)
{
-// ShellPrintEx(-1,-1,L" <Notify> ");
- if ((KeyData->Key.UnicodeChar == L'c' || KeyData->Key.UnicodeChar == 3) &&
+ EFI_INPUT_KEY Key;
+ if ((KeyData->Key.UnicodeChar == L'c' || KeyData->Key.UnicodeChar == 3) &&
(KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))
){
if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) {
@@ -3348,6 +3348,12 @@ NotificationFunction(
(KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))
){
ShellInfoObject.HaltOutput = TRUE;
+
+ //
+ // Make sure that there are no pending keystrokes to pervent the pause.
+ //
+ gST->ConIn->Reset(gST->ConIn, FALSE);
+ while (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key)==EFI_SUCCESS);
}
return (EFI_SUCCESS);
}