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

Search with buffer (-B) over pipe not working as expected #419

Open
Roslaniec opened this issue Aug 24, 2023 · 1 comment
Open

Search with buffer (-B) over pipe not working as expected #419

Roslaniec opened this issue Aug 24, 2023 · 1 comment

Comments

@Roslaniec
Copy link

I see some glitches when using buffer (-B) with search and piped stream

First test scenario:
perl -e 'for (my $i=0; ; $i++) { print($i.("x"x100)."\n"); print "$i test\n" if ($i<400 and !($i%100)); }' | less -nBb1

  • Press: /test
  • Press: n
  • Press: UP or DOWN arrow: nothing happens; less is stuck.
  • Press: LEFT or RIGHT arrow and you will see status: Cannot seek to that file position
  • Press: n again and status is: Pattern not found.
    Notice that program is still running in background, but less is stuck without progress
@Roslaniec
Copy link
Author

Second scenario is even more interesting.
Unzip attached file test.gz

( cat /tmp/test; sleep 10000 ) | less -SBnb100

  • Enter: /asbcuBfDxkOwf379kKqCyg6UidFq
  • Press: nn
  • You will see: Cannot seek to that file position (press RETURN)
  • Press: Ctrl-C
  • Press: UP arrow

At this point program will be stopped and moved into background.
To kill it, you need to do fg, Ctrl-C, q[ENTER]

If you press "q" after Ctrl-C (instead of UP arrow), the program will be stopped and goes into the background as well. But after fg it will immediately quit. This means that the 'q' input was somehow buffered.

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