diff mbox

[edk2,RFC,2/4] Treat ASCII 0x7F as backspace for LinuxTerm terminal

Message ID 1431561241-1411-3-git-send-email-roy.franz@linaro.org
State New
Headers show

Commit Message

Roy Franz May 13, 2015, 11:53 p.m. UTC
Treat ASCII 0x7F as backspace, rather than delete, for Linux terminals.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
---
 MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 51492f3..70ec370 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -1561,8 +1561,14 @@  UnicodeToEfiKey (
     }
 
     if (UnicodeChar == DEL) {
-      Key.ScanCode    = SCAN_DELETE;
-      Key.UnicodeChar = 0;
+      if (TerminalDevice->TerminalType == LINUXTERMTYPE) {
+        Key.ScanCode    = SCAN_NULL;
+        Key.UnicodeChar = CHAR_BACKSPACE;
+      }
+      else {
+        Key.ScanCode    = SCAN_DELETE;
+        Key.UnicodeChar = 0;
+      }
     } else {
       Key.ScanCode    = SCAN_NULL;
       Key.UnicodeChar = UnicodeChar;