Fix backspace in the username login prompt
PATCH 1/1 Fix backspace in the username login prompt
This patch fixes an old bug when backspace key does not work in the username login prompt. It allows BIDI type BN characters (control chars like '\b') in the visual line. And when grub_gfxterm_putchar recieves this line it successfully processes backspace.
---
Hi, I'd like to try to propose this patch again. I'm new to the open source community, so any feedback and suggestions will be appreciated.
grub/grub-core/normal/charset.c | 1 + 1 file changed, 1 insertion(+)
grub/grub-core/normal/charset.c +1 -0
@@ -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 :
Signature · 1 line
2.25.4
First of all, sorry for late reply but I am busy...
Quoted 4 lines · Egor Ignatov
This patch fixes an old bug when backspace key does not work in the username login prompt. It allows BIDI type BN characters (control chars like '\b') in the visual line. And when
grub_gfxterm_putcharrecieves this line it successfully processes backspace.
Did you test this patch with other BIDI type BN characters [1]? I am not convinced it works with them as expected. I think earlier version of your patch was more promising...
Quoted 13 lines
Signed-off-by Egor Ignatov <[email protected]>---
Hi, I'd like to try to propose this patch again. I'm new to the open source community, so any feedback and suggestions will be appreciated.grub/grub-core/normal/charset.c | 1 + 1 file changed, 1 insertion(+)grub/grub-core/normal/charset.c +0
-0
grub/grub-core/normal/charset.c grub_bidi_line_logical_to_visual (const grub_uint32_t *logical, · line 931
Quoted 7 lines
grub/grub-core/normal/charset.c +1
-0@@ -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 :
Daniel
PATCH v2 1/1 Fix backspace in the username login prompt
This patch fixes a bug when backspace key does not work in the username login prompt. It allows backspace characters in the BIDI visual line. Thus grub_gfxterm_putchar receives '\b' chars that were previously ignored.
---
Quoted 1 line
Did you test this patch with other BIDI type BN characters [1]? I am not
You are right, I added a check to handle only backspace characters
Quoted 2 lines
convinced it works with them as expected. I think earlier version of your patch was more promising...
Earlier versions of my patch included workaround for special case when the password is longer than one line. This scenario is not very realistic and I dont think it's worth complicating the codebase.
Thank you for your response.
Let me know if you have any concerns about this version.
Egor
grub-core/normal/charset.c | 2 ++ 1 file changed, 2 insertions(+)
grub-core/normal/charset.c +2 -0
@@ -931,6 +931,8 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,pop_stack ();break ;case GRUB_BIDI_TYPE_BN : +if (visual[visual_len].base =='\b' ) + visual_len++;break ;case GRUB_BIDI_TYPE_R :case GRUB_BIDI_TYPE_AL :
Signature · 1 line
2.29.3
Quoted 14 lines · Egor Ignatov
This patch fixes a bug when backspace key does not work in the username login prompt. It allows backspace characters in the BIDI visual line. Thus
grub_gfxterm_putcharreceives '\b' chars that were previously ignored.Signed-off-by Egor Ignatov <[email protected]>---
Quoted 1 line
Did you test this patch with other BIDI type BN characters [1]? I am not
You are right, I added a check to handle only backspace characters
Quoted 2 lines
convinced it works with them as expected. I think earlier version of your patch was more promising...
Quoted 6 lines
Earlier versions of my patch included workaround for special case when the password is longer than one line. This scenario is not very realistic and I dont think it's worth complicating the codebase.
Thank you for your response.
Let me know if you have any concerns about this version.
Did you test your patch outside of username login prompt, e.g. CLI or menu entry editing? I am afraid your patch breaks at least these cases.
Daniel
Quoted 18 lines
Egor
grub-core/normal/charset.c | 2 ++ 1 file changed, 2 insertions(+)grub-core/normal/charset.c +2
-0@@ -931,6 +931,8 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,pop_stack ();break ;case GRUB_BIDI_TYPE_BN : +if (visual[visual_len].base =='\b' ) + visual_len++;break ;case GRUB_BIDI_TYPE_R :case GRUB_BIDI_TYPE_AL :
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
Quoted 4 lines · Daniel Kiper
Did you test your patch outside of username login prompt, e.g. CLI or menu entry editing? I am afraid your patch breaks at least these cases.
Daniel
Indeed I tested it with both CLI and menu entry editing and it works fine.
Thank you for taking the time to answer me.
Egor