Skip to content

Commit

Permalink
MdeModulePkg/TerminalDxe: Add VTUTF8 to Putty function key map
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4848

This patch is to support VTUTF8 type for Putty function key map.
In Putty, it is required for translating a stream of Unicode characters
for function keys on UTF8 correctly.

Signed-off-by: Phil Noh <[email protected]>
  • Loading branch information
philnoh2 authored and mergify[bot] committed Sep 18, 2024
1 parent 170fa8e commit 21e8a85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,8 @@ AnsiRawDataToUnicode (
Putty function key map:
+=========+======+===========+=============+=============+=============+=========+
| | EFI | | | | | |
| | Scan | | | Normal | | |
| KEY | Code | VT100+ | Xterm R6 | VT400 | Linux | SCO |
| | Scan | VT100+ | | Normal | | |
| KEY | Code | VTUTF8 | Xterm R6 | VT400 | Linux | SCO |
+=========+======+===========+=============+=============+=============+=========+
| F1 | 0x0B | ESC O P | ESC O P | ESC [ 1 1 ~ | ESC [ [ A | ESC [ M |
| F2 | 0x0C | ESC O Q | ESC O Q | ESC [ 1 2 ~ | ESC [ [ B | ESC [ N |
Expand Down
11 changes: 7 additions & 4 deletions MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,8 +1317,8 @@ UnicodeToEfiKeyFlushState (
Putty function key map:
+=========+======+===========+=============+=============+=============+=========+
| | EFI | | | | | |
| | Scan | | | Normal | | |
| KEY | Code | VT100+ | Xterm R6 | VT400 | Linux | SCO |
| | Scan | VT100+ | | Normal | | |
| KEY | Code | VTUTF8 | Xterm R6 | VT400 | Linux | SCO |
+=========+======+===========+=============+=============+=============+=========+
| F1 | 0x0B | ESC O P | ESC O P | ESC [ 1 1 ~ | ESC [ [ A | ESC [ M |
| F2 | 0x0C | ESC O Q | ESC O Q | ESC [ 1 2 ~ | ESC [ [ B | ESC [ N |
Expand Down Expand Up @@ -1395,7 +1395,8 @@ UnicodeToEfiKey (
if ((UnicodeChar == 'O') && ((TerminalDevice->TerminalType == TerminalTypeVt100) ||
(TerminalDevice->TerminalType == TerminalTypeTtyTerm) ||
(TerminalDevice->TerminalType == TerminalTypeXtermR6) ||
(TerminalDevice->TerminalType == TerminalTypeVt100Plus)))
(TerminalDevice->TerminalType == TerminalTypeVt100Plus) ||
(TerminalDevice->TerminalType == TerminalTypeVtUtf8)))
{
TerminalDevice->InputState |= INPUT_STATE_O;
TerminalDevice->ResetState = RESET_STATE_DEFAULT;
Expand Down Expand Up @@ -1569,7 +1570,9 @@ UnicodeToEfiKey (
Key.ScanCode = SCAN_END;
break;
}
} else if (TerminalDevice->TerminalType == TerminalTypeVt100Plus) {
} else if ((TerminalDevice->TerminalType == TerminalTypeVt100Plus) ||
(TerminalDevice->TerminalType == TerminalTypeVtUtf8))
{
switch (UnicodeChar) {
case 'P':
Key.ScanCode = SCAN_F1;
Expand Down

0 comments on commit 21e8a85

Please sign in to comment.