-
Notifications
You must be signed in to change notification settings - Fork 90
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
--pattern overrides -F and tildes up the screen #28
Comments
Is it possible to create a test case that exhibits the problem that does not involve git? I've tried reproducing this but can't quite follow what changes are being made to gitconfig, nor do I have the same files you have, so my git output is different. |
I believe https://superuser.com/questions/951405/less-with-f-option-and-pattern-matching/1626732#1626732 presents the same scenario but without git. Minimal repro:
I'd say
Main issue is that Minor issue about (2): --pattern or
@gwsw WDYT of following ideas: (getting out-of-topic for this specific issue, but trying to map the landscape...)
Hmm, the |
I'm not sure there's anything that can possibly be done here. When a --pattern option is given, less wants to display the screen with the search result positioned at the target line. So we can't start with a less-than-full-page screen (especially if -G is set). |
Just for the record, [edit: all here tested with less-590-5.fc37.x86_64 Fedora linux package.] It occurs to me now that there is also a time dimension to consider when dealing with a slow producer on stdin. Here is a convenient reproducer:
(emits 20 lines over ~20sec on my machine; raise that to say 500000000 to fill a screen and take proportionally longer) less has always supported that nicely, showing incoming input as-it's-arriving. 👏
I wasn't able to similate the magic F, Ctrl+X, search, F sequence using
Should I open a separate issue? [edit: #57 may be it? though that focuses on very-long-line case] |
Not sure if this is the same issue, but I see similar behavior with --header. eg, "echo foo | LESS=F less" behaves "correctly", but "echo foo | LESS=F less --header 1" leaves me with a screen full of tildes. |
Using:
v530 on cygwin
v458 on centos/sles (yay, enterprise distros :( )
.gitconfig snippage
pager.core = less -IqRFX
pager.diff = less -IqRFX --pattern='^diff --git'
With a small git diff, --pattern overrides the -F so the screen is filled with tildes (or newlines if -~ is used) and the top line(s) scroll(s) off the screen. Did some fiddling with -a and prepending @, ^K to the pattern but no change in the unintended behaviour.
Hack that fixes it in the diff, but it would be better to fix it in less itself, especially since this hack breaks less from working with a "larger than a screenfull" change, which is the use case for less in the first place...
Output with pager.diff UNset:
Output with pager.diff set:
The text was updated successfully, but these errors were encountered: