On 2013-09-30 at 03:11:28, ja...@treshna.com wrote: > Package: git > Version: 1:1.7.10.4-1+wheezy1 > Severity: wishlist > > Dear Maintainer, > > if I run "git diff" in a gnome-terminal I get a colorized output but > the scroll wheel doesn't work > > if I run "git diff --color | less -r" > > The scroll wheel works. > > It seems that when git launches less, less doesn't switch to the > alternate screen and thus gnome-terminal doesn't translate scroll > events.
I can reproduce this behaviour, but I think it's documented and expected. Git documents the core.pager environment variable like so: When the LESS environment variable is unset, Git sets it to FRX (if LESS environment variable is set, Git does not change it at all). If you want to selectively override Git’s default setting for LESS, you can set core.pager to e.g. less -S. This will be passed to the shell by Git, which will translate the final command to LESS=FRX less -S. The environment does not set the S option but the command line does, instructing less to truncate long lines. Similarly, setting core.pager to less -+F will deactivate the F option specified by the environment from the command-line, deactivating the "quit if one screen" behavior of less. One can specifically activate some flags for particular commands: for example, setting pager.blame to less -S enables line truncation only for git blame. So the default behaviour is to set LESS=FRX, and the X option does indeed cause the situation you describe (I tested in Alacritty 0.13.2-4+b1 from unstable). However, you can set the `GIT_PAGER` environment variable or `core.pager` config option and get the behaviour you want. For instance, this seems to work for me: GIT_PAGER="env -u LESS less -FR" git log Then I can scroll up and down with the mouse. I'm not sure for the reason for the entire set of options, but the F option at least comes from the desire to avoid needing to exit the pager if there's just one page of text. That's why a small diff for git diff doesn't require the pager. -- brian m. carlson (they/them or he/him) Toronto, Ontario, CA
signature.asc
Description: PGP signature