]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Disable UTF-8 serial by default
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 16 Mar 2010 18:16:15 +0000 (19:16 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 16 Mar 2010 18:16:15 +0000 (19:16 +0100)
term/serial.c

index 53ba65ac9916c1ba7d44145b2b758caaae1ea724..18978911f7554a5fa0ba58c0bb961da4ccc338d2 100644 (file)
@@ -49,6 +49,9 @@ static const struct grub_arg_option options[] =
   {"word",   'w', 0, N_("Set the serial port word length."), 0, ARG_TYPE_INT},
   {"parity", 'r', 0, N_("Set the serial port parity."),      0, ARG_TYPE_STRING},
   {"stop",   't', 0, N_("Set the serial port stop bits."),   0, ARG_TYPE_INT},
+  {"ascii",  'a', 0, N_("Terminal is ASCII-only."),   0, ARG_TYPE_NONE},
+  {"utf8",   'l', 0, N_("Terminal is logical-ordered UTF-8."), 0, ARG_TYPE_NONE},
+  {"visual-utf8",   'v', 0, N_("Terminal is visually-ordered UTF-8."), 0, ARG_TYPE_NONE},
   {0, 0, 0, 0, 0, 0}
 };
 
@@ -453,7 +456,7 @@ static struct grub_term_output grub_serial_term_output =
   .cls = grub_serial_cls,
   .setcolorstate = grub_serial_setcolorstate,
   .setcursor = grub_serial_setcursor,
-  .flags = GRUB_TERM_CODE_TYPE_UTF8_VISUAL,
+  .flags = GRUB_TERM_CODE_TYPE_ASCII,
 };
 
 \f
@@ -538,6 +541,15 @@ grub_cmd_serial (grub_extcmd_t cmd,
        }
     }
 
+  grub_serial_term_output.flags &= ~GRUB_TERM_CODE_TYPE_MASK;
+
+  if (state[7].set)
+    grub_serial_term_output.flags |= GRUB_TERM_CODE_TYPE_UTF8_LOGICAL;
+  else if (state[8].set)
+    grub_serial_term_output.flags |= GRUB_TERM_CODE_TYPE_UTF8_VISUAL;
+  else
+    grub_serial_term_output.flags |= GRUB_TERM_CODE_TYPE_ASCII;
+
   /* Initialize with new settings.  */
   hwiniterr = serial_hw_init ();