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 roy.franz@linaro.org --- 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:
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:roy.franz@linaro.org] Sent: Thursday, May 07, 2015 4:33 PM To: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org; 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 roy.franz@linaro.org --- 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:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
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.
Hi Mike,
I did do my testing at the UEFI shell prompt with line editing. While my patch does remove the use of the ASCII DEL character, there are 3 other terminal escape sequences that are also used for delete. In terraterm over serial, the delete key still works as expected, so it is using an escape sequence. For hyperterm, delete doesn't work before or after my change. For the Linux terminal cases, delete doesn't work at all, as they all use a 3 character VT220 escape "[3~" for delete which EDK2 does not accept. So this certainly will negatively affect terminals that send ASCII DEL (0x7f), but I was not able to find one that did. If this change isn't globally acceptable, I'm fine with restricting this to a terminal type, or making this otherwise configurable (maybe with a fixed PCD?) This fixes a longstanding annoyance (ie backspace key not working) on Linux platforms, which I would like to get fixed, whether via this patch or a similar one.
As an aside, while reviewing the DEL escape codes, I see a simpler way to do this patch, so the current version should not be used.
Thanks, Roy
Thanks,
Mike
-----Original Message----- From: Roy Franz [mailto:roy.franz@linaro.org] Sent: Thursday, May 07, 2015 4:33 PM To: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org; 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 roy.franz@linaro.org
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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel
On 05/08/15 04:26, Roy Franz wrote:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
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.
Hi Mike,
I did do my testing at the UEFI shell prompt with line editing.
While my patch does remove the use of the ASCII DEL character, there are 3 other terminal escape sequences that are also used for delete. In terraterm over serial, the delete key still works as expected, so it is using an escape sequence. For hyperterm, delete doesn't work before or after my change. For the Linux terminal cases, delete doesn't work at all, as they all use a 3 character VT220 escape "[3~" for delete which EDK2 does not accept. So this certainly will negatively affect terminals that send ASCII DEL (0x7f), but I was not able to find one that did.
I think this email provides good background:
https://lists.debian.org/debian-i18n/1998/04/msg00015.html
If this change isn't globally acceptable, I'm fine with restricting this to a terminal type, or making this otherwise configurable (maybe with a fixed PCD?)
Please make this configurable with a fixed PCD or feature PCD.
The key in the upper right corner on my PC keyboard, labeled
<- Backspace
emits keysim BackSpace, and XLookupString gives 0x08, according to "xev".
The key labeled
Delete
emits keysim Delete, and XLookupString gives 0x7F, according to "xev".
Both keys work as expected in all the applications I use, both on the character console and under X (ie. the former key removes the previous character, the latter key removes the next character).
This holds for the UEFI shell as well, when it runs as part of OVMF or ArmVirtualizationQemu, and is accessed over the QEMU serial console, from xterm.
This fixes a longstanding annoyance (ie backspace key not working) on Linux platforms, which I would like to get fixed, whether via this patch or a similar one.
Most Linux distributions' default settings are horribly broken in this area.
<rant> The fact that most applications *agree* on those broken settings doesn't make them less broken.
The obsession on Linux with VT100/VT220 is ridiculous. I was born in the seventies and have never seen a VT100/VT220 keyboard. It's 2015 and we use PC keyboards. Hence, since 1998, I've been doing my part to bludgeon all my applications and remote Linux accounts to do the right thing. Backspace is ^H, Delete is ^?; I own a PC, not some kind of electronic relic. </rant>
So, please make this change dependent on a feature PCD, and the default behavior shouldn't change.
Thanks! Laszlo
As an aside, while reviewing the DEL escape codes, I see a simpler way to do this patch, so the current version should not be used.
Thanks, Roy
Thanks,
Mike
-----Original Message----- From: Roy Franz [mailto:roy.franz@linaro.org] Sent: Thursday, May 07, 2015 4:33 PM To: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org; 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 roy.franz@linaro.org
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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel
Laszlo,
As far as adding a PCD or not, there is another option.
The UEFI Specification defines 4 GUIDs for terminal types that are used in VenMedia() device path nodes and provides the information a terminal driver needs to know to translate a bytes stream to/from a specific type of terminal into UEFI protocol interfaces.
The terminal GUIDs are defined in EDK II in MdePkg/Include/Guid/PcAnsi.h #define EFI_PC_ANSI_GUID \ { \ 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ }
#define EFI_VT_100_GUID \ { \ 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ }
#define EFI_VT_100_PLUS_GUID \ { \ 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \ }
#define EFI_VT_UTF8_GUID \ { \ 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \ }
extern EFI_GUID gEfiPcAnsiGuid; extern EFI_GUID gEfiVT100Guid; extern EFI_GUID gEfiVT100PlusGuid; extern EFI_GUID gEfiVTUTF8Guid;
If we want to support terminal emulators that do not exactly match one of these 4 terminal types, then additional terminal types can be added to the EDK II implementation. I recommend that terminal types that are not defined by UEFI Specification be added to MdeModulePkg and the TerminalDxe driver can add support for these additional terminal types. The only reason to add a feature flag PCD with this direction is if there is a concern on the size impact of building in support for the additional terminal types in TerminalDxe.
Best regards,
Mike
-----Original Message----- From: Laszlo Ersek [mailto:lersek@redhat.com] Sent: Friday, May 08, 2015 2:51 AM To: Roy Franz Cc: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org Subject: Re: [edk2] [PATCH] Treat ASCII DEL (0x7f) as backspace
On 05/08/15 04:26, Roy Franz wrote:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
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.
Hi Mike,
I did do my testing at the UEFI shell prompt with line editing.
While my patch does remove the use of the ASCII DEL character, there are 3 other terminal escape sequences that are also used for delete. In terraterm over serial, the delete key still works as expected, so it is using an escape sequence. For hyperterm, delete doesn't work before or after my change. For the Linux terminal cases, delete doesn't work at all, as they all use a 3 character VT220 escape "[3~" for delete which EDK2 does not accept. So this certainly will negatively affect terminals that send ASCII DEL (0x7f), but I was not able to find one that did.
I think this email provides good background:
https://lists.debian.org/debian-i18n/1998/04/msg00015.html
If this change isn't globally acceptable, I'm fine with restricting this to a terminal type, or making this otherwise configurable (maybe with a fixed PCD?)
Please make this configurable with a fixed PCD or feature PCD.
The key in the upper right corner on my PC keyboard, labeled
<- Backspace
emits keysim BackSpace, and XLookupString gives 0x08, according to "xev".
The key labeled
Delete
emits keysim Delete, and XLookupString gives 0x7F, according to "xev".
Both keys work as expected in all the applications I use, both on the character console and under X (ie. the former key removes the previous character, the latter key removes the next character).
This holds for the UEFI shell as well, when it runs as part of OVMF or ArmVirtualizationQemu, and is accessed over the QEMU serial console, from xterm.
This fixes a longstanding annoyance (ie backspace key not working) on Linux platforms, which I would like to get fixed, whether via this patch or a similar one.
Most Linux distributions' default settings are horribly broken in this area.
<rant> The fact that most applications *agree* on those broken settings doesn't make them less broken.
The obsession on Linux with VT100/VT220 is ridiculous. I was born in the seventies and have never seen a VT100/VT220 keyboard. It's 2015 and we use PC keyboards. Hence, since 1998, I've been doing my part to bludgeon all my applications and remote Linux accounts to do the right thing. Backspace is ^H, Delete is ^?; I own a PC, not some kind of electronic relic. </rant>
So, please make this change dependent on a feature PCD, and the default behavior shouldn't change.
Thanks! Laszlo
As an aside, while reviewing the DEL escape codes, I see a simpler way to do this patch, so the current version should not be used.
Thanks, Roy
Thanks,
Mike
-----Original Message----- From: Roy Franz [mailto:roy.franz@linaro.org] Sent: Thursday, May 07, 2015 4:33 PM To: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org; 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 roy.franz@linaro.org
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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel
On May 12, 2015, at 10:34 AM, Kinney, Michael D michael.d.kinney@intel.com wrote:
Laszlo,
As far as adding a PCD or not, there is another option.
The UEFI Specification defines 4 GUIDs for terminal types that are used in VenMedia() device path nodes and provides the information a terminal driver needs to know to translate a bytes stream to/from a specific type of terminal into UEFI protocol interfaces.
I’ve done this in our local tree and it works great. I added xterm-256color as that is the default terminal type on a Mac.
Thanks,
Andrew Fish
The terminal GUIDs are defined in EDK II in MdePkg/Include/Guid/PcAnsi.h #define EFI_PC_ANSI_GUID \ { \ 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ }
#define EFI_VT_100_GUID \ { \ 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ }
#define EFI_VT_100_PLUS_GUID \ { \ 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \ }
#define EFI_VT_UTF8_GUID \ { \ 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \ }
extern EFI_GUID gEfiPcAnsiGuid; extern EFI_GUID gEfiVT100Guid; extern EFI_GUID gEfiVT100PlusGuid; extern EFI_GUID gEfiVTUTF8Guid;
If we want to support terminal emulators that do not exactly match one of these 4 terminal types, then additional terminal types can be added to the EDK II implementation. I recommend that terminal types that are not defined by UEFI Specification be added to MdeModulePkg and the TerminalDxe driver can add support for these additional terminal types. The only reason to add a feature flag PCD with this direction is if there is a concern on the size impact of building in support for the additional terminal types in TerminalDxe.
Best regards,
Mike
-----Original Message----- From: Laszlo Ersek [mailto:lersek@redhat.com] Sent: Friday, May 08, 2015 2:51 AM To: Roy Franz Cc: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org Subject: Re: [edk2] [PATCH] Treat ASCII DEL (0x7f) as backspace
On 05/08/15 04:26, Roy Franz wrote:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
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.
Hi Mike,
I did do my testing at the UEFI shell prompt with line editing. While my patch does remove the use of the ASCII DEL character, there are 3 other terminal escape sequences that are also used for delete. In terraterm over serial, the delete key still works as expected, so it is using an escape sequence. For hyperterm, delete doesn't work before or after my change. For the Linux terminal cases, delete doesn't work at all, as they all use a 3 character VT220 escape "[3~" for delete which EDK2 does not accept. So this certainly will negatively affect terminals that send ASCII DEL (0x7f), but I was not able to find one that did.
I think this email provides good background:
https://lists.debian.org/debian-i18n/1998/04/msg00015.html
If this change isn't globally acceptable, I'm fine with restricting this to a terminal type, or making this otherwise configurable (maybe with a fixed PCD?)
Please make this configurable with a fixed PCD or feature PCD.
The key in the upper right corner on my PC keyboard, labeled
<- Backspace
emits keysim BackSpace, and XLookupString gives 0x08, according to "xev".
The key labeled
Delete
emits keysim Delete, and XLookupString gives 0x7F, according to "xev".
Both keys work as expected in all the applications I use, both on the character console and under X (ie. the former key removes the previous character, the latter key removes the next character).
This holds for the UEFI shell as well, when it runs as part of OVMF or ArmVirtualizationQemu, and is accessed over the QEMU serial console, from xterm.
This fixes a longstanding annoyance (ie backspace key not working) on Linux platforms, which I would like to get fixed, whether via this patch or a similar one.
Most Linux distributions' default settings are horribly broken in this area.
<rant> The fact that most applications *agree* on those broken settings doesn't make them less broken.
The obsession on Linux with VT100/VT220 is ridiculous. I was born in the seventies and have never seen a VT100/VT220 keyboard. It's 2015 and we use PC keyboards. Hence, since 1998, I've been doing my part to bludgeon all my applications and remote Linux accounts to do the right thing. Backspace is ^H, Delete is ^?; I own a PC, not some kind of electronic relic.
</rant>
So, please make this change dependent on a feature PCD, and the default behavior shouldn't change.
Thanks! Laszlo
As an aside, while reviewing the DEL escape codes, I see a simpler way to do this patch, so the current version should not be used.
Thanks, Roy
Thanks,
Mike
-----Original Message----- From: Roy Franz [mailto:roy.franz@linaro.org] Sent: Thursday, May 07, 2015 4:33 PM To: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org; 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 roy.franz@linaro.org
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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel
On Tue, May 12, 2015 at 10:42 AM, Andrew Fish afish@apple.com wrote:
On May 12, 2015, at 10:34 AM, Kinney, Michael D michael.d.kinney@intel.com wrote:
Laszlo,
As far as adding a PCD or not, there is another option.
The UEFI Specification defines 4 GUIDs for terminal types that are used in VenMedia() device path nodes and provides the information a terminal driver needs to know to translate a bytes stream to/from a specific type of terminal into UEFI protocol interfaces.
I'll take a look at this method of making it configurable. There are so many 'default' terminals in Linux depending on distro, etc. that I don't know what this should be called. I'm not really focused on 'proper' emulation of a specific terminal - I just want the common stuff to work under Linux. I'll put a patch together adding a new terminal type to move the discussion along.
Thanks, Roy
I’ve done this in our local tree and it works great. I added xterm-256color as that is the default terminal type on a Mac.
Thanks,
Andrew Fish
The terminal GUIDs are defined in EDK II in MdePkg/Include/Guid/PcAnsi.h #define EFI_PC_ANSI_GUID \ { \ 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ }
#define EFI_VT_100_GUID \ { \ 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ }
#define EFI_VT_100_PLUS_GUID \ { \ 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \ }
#define EFI_VT_UTF8_GUID \ { \ 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \ }
extern EFI_GUID gEfiPcAnsiGuid; extern EFI_GUID gEfiVT100Guid; extern EFI_GUID gEfiVT100PlusGuid; extern EFI_GUID gEfiVTUTF8Guid;
If we want to support terminal emulators that do not exactly match one of these 4 terminal types, then additional terminal types can be added to the EDK II implementation. I recommend that terminal types that are not defined by UEFI Specification be added to MdeModulePkg and the TerminalDxe driver can add support for these additional terminal types. The only reason to add a feature flag PCD with this direction is if there is a concern on the size impact of building in support for the additional terminal types in TerminalDxe.
Best regards,
Mike
-----Original Message----- From: Laszlo Ersek [mailto:lersek@redhat.com] Sent: Friday, May 08, 2015 2:51 AM To: Roy Franz Cc: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org Subject: Re: [edk2] [PATCH] Treat ASCII DEL (0x7f) as backspace
On 05/08/15 04:26, Roy Franz wrote:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
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.
Hi Mike,
I did do my testing at the UEFI shell prompt with line editing. While my patch does remove the use of the ASCII DEL character, there are 3 other terminal escape sequences that are also used for delete. In terraterm over serial, the delete key still works as expected, so it is using an escape sequence. For hyperterm, delete doesn't work before or after my change. For the Linux terminal cases, delete doesn't work at all, as they all use a 3 character VT220 escape "[3~" for delete which EDK2 does not accept. So this certainly will negatively affect terminals that send ASCII DEL (0x7f), but I was not able to find one that did.
I think this email provides good background:
https://lists.debian.org/debian-i18n/1998/04/msg00015.html
If this change isn't globally acceptable, I'm fine with restricting this to a terminal type, or making this otherwise configurable (maybe with a fixed PCD?)
Please make this configurable with a fixed PCD or feature PCD.
The key in the upper right corner on my PC keyboard, labeled
<- Backspace
emits keysim BackSpace, and XLookupString gives 0x08, according to "xev".
The key labeled
Delete
emits keysim Delete, and XLookupString gives 0x7F, according to "xev".
Both keys work as expected in all the applications I use, both on the character console and under X (ie. the former key removes the previous character, the latter key removes the next character).
This holds for the UEFI shell as well, when it runs as part of OVMF or ArmVirtualizationQemu, and is accessed over the QEMU serial console, from xterm.
This fixes a longstanding annoyance (ie backspace key not working) on Linux platforms, which I would like to get fixed, whether via this patch or a similar one.
Most Linux distributions' default settings are horribly broken in this area.
<rant> The fact that most applications *agree* on those broken settings doesn't make them less broken.
The obsession on Linux with VT100/VT220 is ridiculous. I was born in the seventies and have never seen a VT100/VT220 keyboard. It's 2015 and we use PC keyboards. Hence, since 1998, I've been doing my part to bludgeon all my applications and remote Linux accounts to do the right thing. Backspace is ^H, Delete is ^?; I own a PC, not some kind of electronic relic.
</rant>
So, please make this change dependent on a feature PCD, and the default behavior shouldn't change.
Thanks! Laszlo
As an aside, while reviewing the DEL escape codes, I see a simpler way to do this patch, so the current version should not be used.
Thanks, Roy
Thanks,
Mike
-----Original Message----- From: Roy Franz [mailto:roy.franz@linaro.org] Sent: Thursday, May 07, 2015 4:33 PM To: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org; 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 roy.franz@linaro.org
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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel
On 05/12/2015 01:19 PM, Roy Franz wrote:
On Tue, May 12, 2015 at 10:42 AM, Andrew Fish afish@apple.com wrote:
On May 12, 2015, at 10:34 AM, Kinney, Michael D michael.d.kinney@intel.com wrote:
Laszlo,
As far as adding a PCD or not, there is another option.
The UEFI Specification defines 4 GUIDs for terminal types that are used in VenMedia() device path nodes and provides the information a terminal driver needs to know to translate a bytes stream to/from a specific type of terminal into UEFI protocol interfaces.
I'll take a look at this method of making it configurable. There are so many 'default' terminals in Linux depending on distro, etc. that I don't know what this should be called. I'm not really focused on 'proper' emulation of a specific terminal - I just want the common stuff to work under Linux. I'll put a patch together adding a new terminal type to move the discussion along.
Thanks, Roy
If we have the new terminal type, we can add the details of the implementation as we go. Getting the new GUID into the headers and libraries would be helpful.
Xterm (and modern versions like konsole and gnome-terminal) has some keyboard mapping changes vs. PC-ANSI for function keys and the like. There's also a behavior difference w.r.t. writing the last character on a line, which can bite full-screen applications like the shell's edit command. Let me know if you'd like more details.
On Fri, May 8, 2015 at 2:50 AM, Laszlo Ersek lersek@redhat.com wrote:
On 05/08/15 04:26, Roy Franz wrote:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
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.
Hi Mike,
I did do my testing at the UEFI shell prompt with line editing.
While my patch does remove the use of the ASCII DEL character, there are 3 other terminal escape sequences that are also used for delete. In terraterm over serial, the delete key still works as expected, so it is using an escape sequence. For hyperterm, delete doesn't work before or after my change. For the Linux terminal cases, delete doesn't work at all, as they all use a 3 character VT220 escape "[3~" for delete which EDK2 does not accept. So this certainly will negatively affect terminals that send ASCII DEL (0x7f), but I was not able to find one that did.
I think this email provides good background:
https://lists.debian.org/debian-i18n/1998/04/msg00015.html
If this change isn't globally acceptable, I'm fine with restricting this to a terminal type, or making this otherwise configurable (maybe with a fixed PCD?)
Please make this configurable with a fixed PCD or feature PCD.
The key in the upper right corner on my PC keyboard, labeled
<- Backspace
emits keysim BackSpace, and XLookupString gives 0x08, according to "xev".
The key labeled
Delete
emits keysim Delete, and XLookupString gives 0x7F, according to "xev".
xev reports the same for me.
Both keys work as expected in all the applications I use, both on the character console and under X (ie. the former key removes the previous character, the latter key removes the next character).
This holds for the UEFI shell as well, when it runs as part of OVMF or ArmVirtualizationQemu, and is accessed over the QEMU serial console, from xterm.
Have you you changed any terminal/keyboard settings? What distro do you use? Your experience of working backspace of the QEMU serial port is the first report of this working I have had - it has always been broken for me and everyone I have asked about it.
This fixes a longstanding annoyance (ie backspace key not working) on Linux platforms, which I would like to get fixed, whether via this patch or a similar one.
Most Linux distributions' default settings are horribly broken in this area.
Yeah, this was my first real trip down into the terminal rabbit hole, and it does seem to be a mess.
<rant> The fact that most applications *agree* on those broken settings doesn't make them less broken.
The obsession on Linux with VT100/VT220 is ridiculous. I was born in the seventies and have never seen a VT100/VT220 keyboard. It's 2015 and we use PC keyboards. Hence, since 1998, I've been doing my part to bludgeon all my applications and remote Linux accounts to do the right thing. Backspace is ^H, Delete is ^?; I own a PC, not some kind of electronic relic.
</rant>
I have a feeling that 'proper' VTXXX terminal emulation discussions bring out all the pedants :)
So, please make this change dependent on a feature PCD, and the default behavior shouldn't change.
Thanks! Laszlo
As an aside, while reviewing the DEL escape codes, I see a simpler way to do this patch, so the current version should not be used.
Thanks, Roy
Thanks,
Mike
-----Original Message----- From: Roy Franz [mailto:roy.franz@linaro.org] Sent: Thursday, May 07, 2015 4:33 PM To: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org; 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 roy.franz@linaro.org
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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel
On 05/12/15 20:30, Roy Franz wrote:
On Fri, May 8, 2015 at 2:50 AM, Laszlo Ersek lersek@redhat.com wrote:
On 05/08/15 04:26, Roy Franz wrote:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
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.
Hi Mike,
I did do my testing at the UEFI shell prompt with line editing.
While my patch does remove the use of the ASCII DEL character, there are 3 other terminal escape sequences that are also used for delete. In terraterm over serial, the delete key still works as expected, so it is using an escape sequence. For hyperterm, delete doesn't work before or after my change. For the Linux terminal cases, delete doesn't work at all, as they all use a 3 character VT220 escape "[3~" for delete which EDK2 does not accept. So this certainly will negatively affect terminals that send ASCII DEL (0x7f), but I was not able to find one that did.
I think this email provides good background:
https://lists.debian.org/debian-i18n/1998/04/msg00015.html
If this change isn't globally acceptable, I'm fine with restricting this to a terminal type, or making this otherwise configurable (maybe with a fixed PCD?)
Please make this configurable with a fixed PCD or feature PCD.
The key in the upper right corner on my PC keyboard, labeled
<- Backspace
emits keysim BackSpace, and XLookupString gives 0x08, according to "xev".
The key labeled
Delete
emits keysim Delete, and XLookupString gives 0x7F, according to "xev".
xev reports the same for me.
Both keys work as expected in all the applications I use, both on the character console and under X (ie. the former key removes the previous character, the latter key removes the next character).
This holds for the UEFI shell as well, when it runs as part of OVMF or ArmVirtualizationQemu, and is accessed over the QEMU serial console, from xterm.
Have you you changed any terminal/keyboard settings?
Oh yes, massively.
What distro do you use?
Most of the time, RHEL-7.1 (work laptop); and for much shorter periods, Debian 7.8 (home desktop, historical choice).
Your experience of working backspace of the QEMU serial port is the first report of this working I have had - it has always been broken for me and everyone I have asked about it.
I don't know where I should begin to describe my environment. :) Honestly, I may have already forgotten many of the tweaks I had to do. In any case we can try this: I'll give a few facts about my setup that I can think of, and you could see if they help on your side.
(1) So, as terminal emulator I use xterm. On RHEL-7.1, the version is xterm-295-3.el7.x86_64, on Debian it is 278-4.
(2) In ~/.Xresources on the RHEL-7.1 laptop, I have the following (relevant) entries:
xterm*deleteIsDEL: true ! xterm*backarrowKeyIsErase: false xterm*backarrowKey: true xterm*ttyModes: erase ^H
Whereas on the Debian machine I have:
xterm*deleteIsDEL: true ! Undo the debian peculiarity in /usr/X11R6/lib/X11/app-defaults/XTerm ! that makes the backarrowKey resource ineffective. *backarrowKeyIsErase: false
(This is already a nice example how distros disagree and/or require a different set of options -- in any case, the comment on Debian is outdated; that file doesn't exist any longer. ;))
In any case, if I hold down Ctrl + Left-MouseBtn in xterm, xterm displays a menu with some toggles, and on both machines I get: - Backarrow Key (BS/DEL): checked -- I think it corresponds to the "backarrowKey" resource above (see the manual) - Delete is DEL: checked -- and this should be the "deleteIsDEL" resource
(3) stty reports "erase = ^H" on both machines. I think on RHEL that's because of the above "ttyModes" xterm resource, and on Debian it's due to the fact that I have "stty erase ^H" in ~/.bashrc.
(4) In ~/.inputrc I have (for readline-based apps), among other things, on both machines:
"\d": delete-char "\b": backward-delete-char
... That's all I can think of now.
This fixes a longstanding annoyance (ie backspace key not working) on Linux platforms, which I would like to get fixed, whether via this patch or a similar one.
Most Linux distributions' default settings are horribly broken in this area.
Yeah, this was my first real trip down into the terminal rabbit hole, and it does seem to be a mess.
<rant> The fact that most applications *agree* on those broken settings doesn't make them less broken.
The obsession on Linux with VT100/VT220 is ridiculous. I was born in the seventies and have never seen a VT100/VT220 keyboard. It's 2015 and we use PC keyboards. Hence, since 1998, I've been doing my part to bludgeon all my applications and remote Linux accounts to do the right thing. Backspace is ^H, Delete is ^?; I own a PC, not some kind of electronic relic.
</rant>
I have a feeling that 'proper' VTXXX terminal emulation discussions bring out all the pedants :)
I'm a pedant, but not *for* VTXXX :)
Hope the above settings help.
Cheers Laszlo
So, please make this change dependent on a feature PCD, and the default behavior shouldn't change.
Thanks! Laszlo
As an aside, while reviewing the DEL escape codes, I see a simpler way to do this patch, so the current version should not be used.
Thanks, Roy
Thanks,
Mike
-----Original Message----- From: Roy Franz [mailto:roy.franz@linaro.org] Sent: Thursday, May 07, 2015 4:33 PM To: edk2-devel@lists.sourceforge.net; linaro-uefi@lists.linaro.org; 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 roy.franz@linaro.org
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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net 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%3B117567292%3By _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel
On 05/12/2015 04:27 PM, Laszlo Ersek wrote:
On 05/12/15 20:30, Roy Franz wrote:
On Fri, May 8, 2015 at 2:50 AM, Laszlo Ersek lersek@redhat.com wrote:
On 05/08/15 04:26, Roy Franz wrote:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
[snip....]
<rant> The fact that most applications *agree* on those broken settings doesn't make them less broken.
The obsession on Linux with VT100/VT220 is ridiculous. I was born in the seventies and have never seen a VT100/VT220 keyboard. It's 2015 and we use PC keyboards. Hence, since 1998, I've been doing my part to bludgeon all my applications and remote Linux accounts to do the right thing. Backspace is ^H, Delete is ^?; I own a PC, not some kind of electronic relic.
</rant>
I have a feeling that 'proper' VTXXX terminal emulation discussions bring out all the pedants :)
I'm a pedant, but not *for* VTXXX :)
Hope the above settings help.
Cheers Laszlo
Pfft. Kids these days :-).
Some of us fondly remember the VT100 as a step up from the ASR33 teletype, or the ADM 3A CRT :-D.
On 05/12/2015 04:27 PM, Laszlo Ersek wrote:
On 05/12/15 20:30, Roy Franz wrote:
On Fri, May 8, 2015 at 2:50 AM, Laszlo Ersek lersek@redhat.com wrote:
On 05/08/15 04:26, Roy Franz wrote:
On Thu, May 7, 2015 at 7:03 PM, Kinney, Michael D michael.d.kinney@intel.com wrote:
[snip....]
<rant> The fact that most applications *agree* on those broken settings doesn't make them less broken.
The obsession on Linux with VT100/VT220 is ridiculous. I was born in the seventies and have never seen a VT100/VT220 keyboard. It's 2015 and we use PC keyboards. Hence, since 1998, I've been doing my part to bludgeon all my applications and remote Linux accounts to do the right thing. Backspace is ^H, Delete is ^?; I own a PC, not some kind of electronic relic.
</rant>
I have a feeling that 'proper' VTXXX terminal emulation discussions bring out all the pedants :)
I'm a pedant, but not *for* VTXXX :)
Hope the above settings help.
Cheers Laszlo
Pfft. Kids these days :-).
Some of us fondly remember the VT100 as a step up from the ASR33 teletype, or the ADM 3A CRT :-D.