Re: [PATCH] more: ensure that on larger terminals 'h' shows only the in-app help text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 19, 2025 at 02:32:28PM +0100, Karel Zak wrote:
> On Tue, Mar 18, 2025 at 12:01:08PM +0100, Benno Schulenberg wrote:
> > When a terminal has more than 24 rows, the rows above the help text
> > (shown by typing 'h' or '?') were still those of the displayed file.
> > That could make it hard to notice that the two lines above the first
> > row of dashes belonged to the help text, not to the displayed file.
> 
> This is a misunderstanding. By default, more(1) is in scroll mode, and
> the help output is added to the display. Therefore, it is expected
> that you see data from the file as well as the help text. You need to
> use -c or -p to clear the screen before it prints the help text.

Note that I agree the output is not very readable, and it would be
better to start the entire help output with a separator, something
like:

diff --git a/text-utils/more.c b/text-utils/more.c
index a035591af..92b257046 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -1545,6 +1545,7 @@ static char *find_editor(void)
 
 static void runtime_usage(void)
 {
+	print_separator('-', 79);
 	fputs(_("Most commands optionally preceded by integer argument k.  "
 		"Defaults in brackets.\n"
 		"Star (*) indicates argument becomes new default.\n"), stdout);


-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com





[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux