Subject: Re: git fails with a broken pipe when one quits the pager

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Wed, 03 Feb 2021 03:48:22 +0100

On Mon, Feb 01 2021, Johannes Sixt wrote:

> Am 01.02.21 um 16:44 schrieb Ævar Arnfjörð Bjarmason:
>> On Mon, Feb 01 2021, Vincent Lefevre wrote:
>>> On 2021-02-01 13:10:21 +0100, Ævar Arnfjörð Bjarmason:
>>>> So we've got the SIGPIPE to indicate the output wasn't fully
>>>> consumed.
>>>
>>> But the user doesn't care: he quit the pager because he didn't
>>> need more output. So there is no need to signal that the output
>>> wasn't fully consumed. The user already knew that before quitting
>>> the pager!
>> 
>> As noted above, this is assuming way too much about the functionality of
>> the pager command. We can get a SIGPIPE without the user's intent in
>> this way. Consider e.g. piping to some remote system via netcat.
>
> That assumption is warranted, IMO. Aren't _you_ stretching the meaning
> of "pager" too far here? A pager is intended for presentation to the
> user. If someone plays games with it, they should know what they get.

FWIW I replied to this in
https://lore.kernel.org/git/[email-masked]/

Whatever anyone thinks of the virtues of passing down SIGHUP having e.g
a nc to a remote box be your pager isn't all that unusual.