Skip to content

Regression: Initial filter kicks in late #759

@GfEW

Description

@GfEW

The Problem

There are three kinds of unexpected behavior with initial filters in v696 and up (could be v693 and up). This issue is named after the most substantial of the three, but it also describes the other two, because they appear to be closely related.

How to reproduce?

Setup:

for ((i=1;i<=50;i++)); do
  echo $((i));
  sleep 1 || break;
done |
LESSNOCONFIG='LESS_LINES' LESS_LINES=10 less -M --use-backslash $'+&[02468]\$\nF'
  1. Watch lines 1 through 8 coming in.
  • 1a. Notice the filter is not active.
  • 1b. Notice that all lines are printed in order, from the top down to the bottom.
  • 1c. Notice the F mode prompt line is missing.
  1. Watch lines 9 through 17 coming in.
  • 2a. Notice the filter kicks in at the moment line 9 is being read, i. e. when there are enough unfiltered lines to fill the content area.
  • 2b. Notice there's a sudden jump in the movement of content lines on screen at that same moment.
  • 2c. Notice the F mode prompt line is still missing.
  1. Watch lines 18 and up coming in.
  • 3a. (OK)
  • 3b. Notice that content lines start to scroll upwards (as expected) at the moment line 20 is being read.
  • 3c. Notice the F mode prompt line appears at the moment line 18 is being read, i. e. when there are enough filtered lines to fill the content area.
  1. Type ^Xq to quit less.

What should happen instead?

Short answer:

Test and see less v692.

Long answer:

  • 1a. The filter should be active from the start.
  • 2b. There should be no "jumps" (larger than single line scrolling steps, that is) in the movement of content lines on screen, as they keep coming in.
  • 3c. The Waiting for data ... prompt line should be visible from the start.
    (I'm not sure about this part, but v692 does display the F mode prompt immediately while the content area is being filled, which feels more consistent and informative than a blank prompt.)

Additional Context

  • Whilst the combination of LESS_LINES and F mode produces the symptoms described above, variants of the latter are also present with only one or none of those options.
  • Apparently, the problem got introduced between v692 and v696, as v692 behaves correctly in all three regards (1a, 2b, 3c).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions