git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: why does git set X in LESS env var?

From
Christoph Anton Mitterer <calestyo@scientia.org>
Date
Oct 12, 2023, 21:48 UTC
Message-ID
<c6cd3133573d5ade6d02b5da1051853a4b3885e1.camel@scientia.org>
In-Reply-To
<31b6f4a2b88cc3a2cfa908f82f4f2302@manjaro.org>
On Thu, 2023-10-12 at 23:15 +0200, Dragan Simic wrote:
Show 7 quoted lines
> 
> Ah, I can finally see what are you talking about...  Thank you very
> much 
> for all the testing you've performed and for supplying this screen 
> recording!  I can confirm that my environment is also affected, but
> for 
> some reason I haven't observed it this way before.

Well... perhaps because it's not really "easy" to spot unless one carefully reads through the lines (which I guess, one does not that often in the terminal "history").

Have a look at my ticket at less, especially: https://github.com/gwsw/less/issues/445#issuecomment-1758887183

Where it was confirmed that the issue I describe might happen (and I guess is non-fixable?

The whole issue also contains an explanation on why scrolling doesn't work when -X is used (but --mouse is not) on VTE terminals (and maybe others, though not xterm). And it's basically not "fixable" but simply "by design".

> Huh, that's really worrisome and I'm willing to help you with
> debugging 
> and fixing this issue.  Please, let me perform some debugging and 
> digging around, and I'll come back to you with some further insights,

Well, my assumption (though I'm really not a terminal expert) would be that it's not fixable... because less would somehow make sure that everything it prints (in the alt screen buffer) is properly concatenated in the the regular one.

less upstream made some suggestions: https://github.com/gwsw/less/issues/445#issuecomment-1759986293

One would be to change the terminfo entry, which I guess is not really feasible as a general solution.

The other would be less’ --redraw-on-quit option.

Maybe that would be an even better solution for git? AFAICS, we could have -F, the VTE mouse scrolling out of the box, plus (via that option) the final screen buffer of less printed when exiting.

Would give some context (what one did in the pager, where one was) on the regular screen buffer, but (presumably) avoid that mess up... and perhaps even prevent unneeded pages of output from the pager, if one scrolled down a lot, which maybe aren't even needed?

(Also note, that less` upstream calls `-X` "a risky flag" ;-) )
> Those people, just as anyone else, can use $PAGER or $GIT_PAGER to 
> configure the pagination the way they like it.  In the end, that's
> also 
> what I do in my environment.

Sure... all I said, that (IMO) in the case of `-X` it's not like with `-R` but rater like with `-S`... i.e. neither mode has more right to be the default than the other.

Cheers, Chris.

Previous: Dragan SimicNext: Dragan Simic
Message 15 of 39 in “why does git set X in LESS env var?”
  1. Christoph Anton MittererOct 11, 2023
  2. Junio C HamanoOct 11, 2023
  3. Christoph Anton MittererOct 11, 2023
  4. Dragan SimicOct 11, 2023
  5. Christoph Anton MittererOct 11, 2023
  6. Dragan SimicOct 11, 2023
  7. Christoph Anton MittererOct 11, 2023
  8. Dragan SimicOct 12, 2023
  9. Christoph Anton MittererOct 12, 2023
  10. Dragan SimicOct 12, 2023
  11. Christoph Anton MittererOct 12, 2023
  12. Dragan SimicOct 12, 2023
  13. Christoph Anton MittererOct 12, 2023
  14. Dragan SimicOct 12, 2023
  15. Christoph Anton MittererOct 12, 2023
  16. Dragan SimicOct 12, 2023
  17. Christoph Anton MittererOct 12, 2023
  18. Dragan SimicOct 13, 2023
  19. Christoph Anton MittererOct 13, 2023
  20. Dragan SimicOct 13, 2023
  21. Jeff KingOct 12, 2023
  22. Dragan SimicOct 12, 2023
  23. Junio C HamanoOct 12, 2023
  24. Dragan SimicOct 12, 2023
  25. Junio C HamanoOct 12, 2023
  26. Dragan SimicOct 13, 2023
  27. Christoph Anton MittererOct 12, 2023
  28. Dragan SimicOct 12, 2023
  29. Thomas GuyotNov 2, 2023
  30. Dragan SimicNov 2, 2023
  31. Dragan SimicNov 2, 2023
  32. Thomas GuyotNov 2, 2023
  33. Dragan SimicNov 2, 2023
  34. Thomas GuyotNov 3, 2023
  35. Andy KoppeNov 3, 2023
  36. Dragan SimicNov 3, 2023
  37. Dragan SimicNov 3, 2023
  38. Dragan SimicNov 6, 2023
  39. Dragan SimicMar 21, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.