Roy,

Did you try the command line at the UEFI Shell prompt through a serial 
terminal?  There is line editing available, where backspace and delete keys 
perform different actions.  I think your change prevents a user from ever 
getting the delete key behavior.  Same would be true for the UEFI Shell command 
EDIT that provides a text file editor.

Thanks,

Mike

-----Original Message-----
From: Roy Franz [mailto:[email protected]] 
Sent: Thursday, May 07, 2015 4:33 PM
To: [email protected]; [email protected]; Tian, Feng
Subject: [edk2] [PATCH] Treat ASCII DEL (0x7f) as backspace

Most Linux terminal emulators use ASCII 0x7f (^?) for backspace,
rather than 0x08 (^H) since ^H is used by some programs for other
purposes, such as help menus.  This results in backspace not working
in most Linux environments, particularly in emulated environments
such as QEMU where telnet or xterm may be used to connect to
the emulated UART.  While in some cases this can be configured in the
terminal emulator, it must be done on every connection, as if
permently configured this will break all other uses of the terminal.

This change causes both ASCII 0x08 and 0x7F to be treated as
backspace.  This provides a working backspace when tested with
minicom, screen, telnet, and xterm under Linux.  I also tested
teraterm and hyperterm under Windows connecting via rs232, and
saw no regressions. (The delete key doesn't work on hyperterm
both before and after the change)

This change removes the ASCII encoding for delete, however
this did not cause regressions on any tested terminal emulators
as they do not use the ASCII encoding for the delete key.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Roy Franz <[email protected]>
---
 MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c 
b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 4a008c9..c92d3d4 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -1212,6 +1212,14 @@ UnicodeToEfiKey (
     switch (TerminalDevice->InputState) {
     case INPUT_STATE_DEFAULT:
 
+        switch (UnicodeChar) {
+        case 0x7f:
+          UnicodeChar = CHAR_BACKSPACE;
+          break;
+        default :
+          break;
+        }
+
       break;
 
     case INPUT_STATE_ESC:
-- 
1.9.1


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to