Re: [PATCH v2] Fix backspace in the username login prompt

2021-05-18 Thread egori
Indeed I tested it with both CLI and menu entry editing and it works fine.

Thank you for taking the time to answer me.

PS Sorry if you received this message more than once.

Egor

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] password: Fix backspace in username prompt

2021-03-31 Thread egori
From: Egor Ignatov 

Allow control characters in the bidi visual.
Resolves: #60114

Signed-off-by: Egor Ignatov 
---
 grub/grub-core/normal/charset.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/grub/grub-core/normal/charset.c b/grub/grub-core/normal/charset.c
index b0ab47d73..30e819bdf 100644
--- a/grub/grub-core/normal/charset.c
+++ b/grub/grub-core/normal/charset.c
@@ -925,6 +925,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t 
*logical,
pop_stack ();
break;
  case GRUB_BIDI_TYPE_BN:
+   visual_len++;
break;
  case GRUB_BIDI_TYPE_R:
  case GRUB_BIDI_TYPE_AL:
-- 
2.25.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH v2] password: Fix backspace in username prompt

2021-03-17 Thread egori
From: Egor Ignatov 

Make backspace work in superuser login prompt.

The problem was that bidi logical to visual ignored BN type,
so you couldn't print control characters.

Resolves: #60114
Signed-off-by: Egor Ignatov 
---
 grub-core/normal/charset.c | 1 +
 grub-core/term/gfxterm.c   | 9 -
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c
index 4dfcc3107..77073c12f 100644
--- a/grub-core/normal/charset.c
+++ b/grub-core/normal/charset.c
@@ -931,6 +931,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t 
*logical,
pop_stack ();
break;
  case GRUB_BIDI_TYPE_BN:
+   visual_len++;
break;
  case GRUB_BIDI_TYPE_R:
  case GRUB_BIDI_TYPE_AL:
diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c
index af7c090a3..5b0660cd2 100644
--- a/grub-core/term/gfxterm.c
+++ b/grub-core/term/gfxterm.c
@@ -847,7 +847,14 @@ grub_gfxterm_putchar (struct grub_term_output *term,
 {
 case '\b':
   if (virtual_screen.cursor_x > 0)
-virtual_screen.cursor_x--;
+{
+  virtual_screen.cursor_x--;
+}
+  else if (virtual_screen.cursor_y > 0)
+{
+  virtual_screen.cursor_y--;
+  virtual_screen.cursor_x = virtual_screen.columns-2;
+}
   break;
 
 case '\n':
-- 
2.25.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel