]> git.proxmox.com Git - grub2.git/commitdiff
* grub-core/term/efi/console.c (grub_console_getkey): Accept VT100-style
authorPawel Wojtalczyk <eyak@wp.pl>
Wed, 18 Sep 2013 16:58:09 +0000 (18:58 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 18 Sep 2013 16:58:09 +0000 (18:58 +0200)
codes.

Also-By: Vladimir Serbinenko <phcoder@gmail.com>
ChangeLog
grub-core/term/efi/console.c

index a972b99591f237c267ecd43b4b9f4c54b8c1f9d3..aabb82f0e134c050a3d361575332fbe4842b4b6f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,12 @@
        * docs/grub.texi (Networking commands): Add documentation for
        network related commands.
 
+2013-09-18  Pawel Wojtalczyk <eyak@wp.pl>
+2013-09-18  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/term/efi/console.c (grub_console_getkey): Accept VT100-style
+       codes.
+
 2013-09-18  Colin Watson  <cjwatson@ubuntu.com>
 
        * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name_iter):
index 9f76d23c0f1f47425d7ce9404ff05949b8c774de..fad23d2d4b7ec0dbcccea2f7417538be37d06315 100644 (file)
@@ -125,7 +125,17 @@ grub_console_getkey (struct grub_term_input *term __attribute__ ((unused)))
     return GRUB_TERM_NO_KEY;
 
   if (key.scan_code == 0)
-    return key.unicode_char;
+    {
+      /* Some firmware implementations use VT100-style codes against the spec.
+        This is especially likely if driven by serial.
+       */
+      if (key.unicode_char < 0x20 && key.unicode_char != 0
+         && key.unicode_char != '\t' && key.unicode_char != '\b'
+         && key.unicode_char != '\n' && key.unicode_char != '\r')
+       return GRUB_TERM_CTRL | (key.unicode_char - 1 + 'a');
+      else
+       return key.unicode_char;
+    }
   else if (key.scan_code < ARRAY_SIZE (efi_codes))
     return efi_codes[key.scan_code];