#940288 less: with a pipe, the line numbers can artificially be turned off after Ctrl-C

Package:
less
Source:
less
Description:
pager program similar to more
Submitter:
Vincent Lefevre
Date:
2024-05-01 02:03:05 UTC
Severity:
normal
Tags:
#940288#5
Date:
2019-09-15 10:17:28 UTC
From:
To:
Run the following command:

  ( trap '' INT; while true; do echo foo; done; ) | less

Then type /w [Return] to search for "w" (there isn't any match).
And type Ctrl-C to abort. One gets:

  Pattern not found  (press RETURN)

Then type [End] to go to the end, but since this is an infinite loop
here[*], this will hang. Type Ctrl-C to abort. One gets:

  Line numbers turned off  (press RETURN)

while there is no reason to turn the line numbers off. For instance,
one does not get this issue with just several aborted searches or with
just several aborted [End].

I can also reproduce this bug with less 481 (Debian/stretch) and 487.

[*] In practice, this can just be a command with a lot of output, but
which hasn't finished yet.