GNU bug report logs - #47243
pr lacks -p

Previous Next

Package: coreutils;

Reported by: Eric Blake <eblake <at> redhat.com>

Date: Thu, 18 Mar 2021 15:39:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Collin Funk <collin.funk1 <at> gmail.com>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 47243 <at> debbugs.gnu.org
Subject: bug#47243: pr lacks -p
Date: Mon, 28 Jul 2025 10:36:02 -0700
Pádraig Brady <P <at> draigBrady.com> writes:

> Reading POSIX more closely I see there is also pause logic for the first page only:
>   -f    [XSI] [Option Start] Use a <form-feed> for new pages, instead of the default behavior that uses a sequence of <newline> characters.
>         Pause before beginning the first page if the standard output is associated with a terminal. [Option End]

Thanks, I'll have a look.

> I presume you're waiting until the implementation solidifies,
> but just in case, a couple of basic tests to show
> that -p is accepted at least would be good.

Yep, I was going to add some simple tests afterwards.

Paul Eggert said:

> On 2025-07-28 09:23, Pádraig Brady wrote:
>> Yes it's a fair point.
>> We don't want existing scripts that use -f to start pausing unexpectedly.
>> I suppose this is a case for only pausing with -f if POSIXLY_CORRECT
>> env var is set.

> Although backward compatibility is an issue, the current behavior is
> clearly wrong for the intended use of -f, which is for logins via
> printing terminals so stdout is the printer. So a better way to think
> about it is that this is merely a longstanding obscure bug in GNU 'pr'
> that we can fix.
>
> The only reason we haven't noticed the bug before, is that nobody has
> seriously used those terminals in decades, so nobody has run into the
> bug and taken the time to report it.
>
> Other 'pr' implementations (e.g., FreeBSD) do the right thing here,
> and I see no significant reason (other than inertia) for us to be both
> wrong for the intended use and incompatible with the rest of the
> world.

I don't really like the idea of changing '-f' depending on whether
POSIXLY_CORRECT is defined. So I would prefer this as well.

I'll write another patch later today based on your other emails as well.

Collin




This bug report was last modified 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.