Add paging instructions to normal and help prompts
v3 cover Add paging instructions to normal and help prompts
Rewrite to address review and clarifications with suggestion from Daniel (thanks).
Be well,
--Robbie
Robbie Harwood (1):
Add paging instructions to normal and help prompts
grub-core/commands/help.c | 2 ++ grub-core/normal/main.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.35.1
PATCH v3 1/1 Add paging instructions to normal and help prompts
This is not an ideal solution, as interactive users must always ru na command in order to get the behavior they want, but it avoids problematic interactions between prompting and sourcing files.
--- grub-core/commands/help.c | 2 ++ grub-core/normal/main.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
grub-core/commands/help.c +2 -0
@@ -135,6 +135,8 @@ grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, } } +grub_printf ("\n\nTo enable less(1)-like paging, `set pager=1`.\n" ); +return 0 ; }
grub-core/normal/main.c +2 -1
@@ -380,7 +380,8 @@ grub_normal_reader_init (int nested) msg_formatted =grub_xasprintf (_ ("Minimal BASH-like line editing is supported. For " "the first word, TAB lists possible command completions. Anywhere " -"else TAB lists possible device or file completions. %s" ), +"else TAB lists possible device or file completions. To enable " +"less(1)-like paging, `set pager=1`. %s" ), nested ? msg_esc :"" );if (!msg_formatted)return grub_errno;
Signature · 1 line
2.35.1
Quoted 5 lines · Robbie Harwood
This is not an ideal solution, as interactive users must always ru na command in order to get the behavior they want, but it avoids problematic interactions between prompting and sourcing files.
Signed-off-by Robbie Harwood <[email protected]>
Quoted 10 lines
--- grub-core/commands/help.c | 2 ++ grub-core/normal/main.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)grub-core/commands/help.c +0
-0
grub-core/commands/help.c grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, · line 138
Quoted 4 lines
grub-core/commands/help.c +1
-0@@ -135,6 +135,8 @@ grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, } } +grub_printf ("\n\nTo enable less(1)-like paging, `set pager=1`.\n" );
Are you OK with s/`/\"/g? If yes I can do it for you before committing this patch?
Quoted 9 lines
grub-core/commands/help.c +1
-0+return 0 ; }grub-core/normal/main.c +0
-0
grub-core/normal/main.c grub_normal_reader_init (int nested) · line 384
Quoted 6 lines
grub-core/normal/main.c +2
-1@@ -380,7 +380,8 @@ grub_normal_reader_init (int nested) msg_formatted = grub_xasprintf (_("Minimal BASH-like line editing is supported. For " "the first word, TAB lists possible command completions. Anywhere " - "else TAB lists possible device or file completions. %s"), + "else TAB lists possible device or file completions. To enable " + "less(1)-like paging, `set pager=1`. %s"),
Do we need extra spaces here? I would be consistent with the rest of the message and use one space everywhere? Again, I can make these changes for you if you are OK with them.
Daniel
Quoted 15 lines · Daniel Kiper
Quoted 13 lines · Robbie Harwood
--- grub-core/commands/help.c | 2 ++ grub-core/normal/main.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)grub-core/commands/help.c +0
-0@@ -135,6 +135,8 @@ grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, } }
Quoted 4 lines
grub-core/commands/help.c grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc, · line 138
Quoted 1 line
grub-core/commands/help.c +1
-0+grub_printf ("\n\nTo enable less(1)-like paging, `set pager=1`.\n" );Are you OK with s/`/\"/g? If yes I can do it for you before committing this patch?
That's fine.
Quoted 10 lines
Quoted 10 lines
grub-core/commands/help.c +1
-0+return 0 ; }grub-core/normal/main.c +0
-0@@ -380,7 +380,8 @@ grub_normal_reader_init (int nested)
Quoted 9 lines
grub-core/normal/main.c grub_normal_reader_init (int nested) · line 384
Quoted 5 lines
grub-core/normal/main.c +2
-1msg_formatted = grub_xasprintf (_("Minimal BASH-like line editing is supported. For " "the first word, TAB lists possible command completions. Anywhere " - "else TAB lists possible device or file completions. %s"), + "else TAB lists possible device or file completions. To enable " + "less(1)-like paging, `set pager=1`. %s"),Do we need extra spaces here? I would be consistent with the rest of the message and use one space everywhere? Again, I can make these changes for you if you are OK with them.
Also fine, thanks.
Be well,
--Robbie