[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/1] normal: Add paging instructions to interactive prompt
From: |
Daniel Kiper |
Subject: |
Re: [PATCH v2 1/1] normal: Add paging instructions to interactive prompt |
Date: |
Fri, 4 Nov 2022 13:59:18 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Thu, Nov 03, 2022 at 05:50:51PM -0400, Robbie Harwood wrote:
> Daniel Kiper <dkiper@net-space.pl> writes:
> > On Mon, Oct 31, 2022 at 03:35:49PM -0400, Robbie Harwood wrote:
> >> Conditionally add instructions for enabling paging to the prompt of
> >> interactive shells. This is not an ideal solution, as ineractive users
> >> must always run a command in order to get the behavior they want, but it
> >> avoids problematic interactions between prompting and sourcing files.
> >>
> >> Signed-off-by: Robbie Harwood <rharwood@redhat.com>
> >> ---
> >> grub-core/normal/main.c | 4 +++-
> >> grub-core/normal/term.c | 6 ++++++
> >> include/grub/normal.h | 1 +
> >> 3 files changed, 10 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
> >> index cb0e8e7fd2..d9d7c4ad28 100644
> >> --- a/grub-core/normal/main.c
> >> +++ b/grub-core/normal/main.c
> >> @@ -411,9 +411,11 @@ grub_normal_read_line_real (char **line, int cont,
> >> int nested)
> >> if (cont)
> >> /* TRANSLATORS: it's command line prompt. */
> >> prompt = _(">");
> >> - else
> >> + else if (grub_get_more())
> >> /* TRANSLATORS: it's command line prompt. */
> >> prompt = _("grub>");
> >> + else
> >> + prompt = _("(enable paging with `set pager=1`) grub>");
> >
> > Do we really need to update prompt? Why do not print it once at the top
> > of the screen after entering into normal mode first time?
>
> My thinking was this: if a user enters the command prompt from the menu
> and types "help", then not only is it not paginated, but the
> instructions for enabling pagination have scrolled off the screen.
Why do not add instructions for enabling pagination at the end of "help"
command print out?
> Rereading I do see that you and Vladimir were after the initial blob,
> not the command line prompt. I don't know if I agree that's
> sufficient... will think about it more, I guess.
OK...
Daniel