Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No "waiting for data" message when using F command on a pipe #555

Open
gwsw opened this issue Aug 5, 2024 · 1 comment
Open

No "waiting for data" message when using F command on a pipe #555

gwsw opened this issue Aug 5, 2024 · 1 comment

Comments

@gwsw
Copy link
Owner

gwsw commented Aug 5, 2024

Steps to reproduce:

  1. Run i=0; while :; do echo $i; let i=$i+1; sleep .2; done > file &.
  2. Run less file.
  3. Type F.
  4. Note that a "Waiting for data" message appears while content is scrolling.
  5. Exit less.
  6. Run i=0; while :; do echo $i; let i=$i+1; sleep .2; done | less.
  7. Type F.

Expected behavior:
A "Waiting for data" message should appears as in the case of viewing a regular file.

Actual behavior:
No "Waiting for data" message is visible.

@gwsw
Copy link
Owner Author

gwsw commented Aug 7, 2024

Actually the lack of the "waiting for data" message in this case is by design. See #337. The message can be made to appear by setting LESS_DATA_DELAY to a small number (less than 200 in this case). The inconsistency is arguably a problem in the case of viewing a file, in which it's reasonable to argue that the message should NOT appear, similar to the behavior for a pipe. The fact that the message does appear is due to the behavior of poll() which always returns POLLIN for a regular file, even if you are at EOF and no data is actually readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant