Re: why does git set X in LESS env var?
- From
- Dragan Simic <dsimic@manjaro.org>
- Date
- Nov 3, 2023, 18:38 UTC
- Message-ID
- <db923ad4f3fba79e2a2e279f6d5aff16@manjaro.org>
- In-Reply-To
- <CAHWeT-aftfawZ9DhqC1NkQrJAuArJZC65ZDr4FyPwEc7aXGVuA@mail.gmail.com>
On 2023-11-03 16:28, Andy Koppe wrote:
Show 6 quoted lines
> Thomas Guyot wrote: >> >> I actually have one major issue with it, it's that displaying anything >> >> less than a full page will fill the screen with ~ on the bottom, just >> >> like when scrolling up on a partial page without -F. > > 'less' has the '-~' (or --tilde) option to suppress that.
Good to know, thanks. However, with the "-F" option in place, the situation in which less than a full page is displayed within less(1) shouldn't be encountered.
Show 6 quoted lines
> For what it's worth, the 'mintty' terminal used by default for Git for > Windows as well as MSYS and Cygwin has another approach to the whole > problem. Its rather flippantly named 'Flip Screen' context menu > command with Alt+F12 or Ctrl+Shift+S shortcut lets users temporarily > look at the alternate screen buffer while the main screen buffer is > active, and vice versa.
This is a rather neat feature. Though, I wonder how many users are actually aware of this feature, and how frequently is it used. I wasn't aware of it, and I used Git CLI on Windows for some time.
Show 7 quoted lines
> If 'less' is invoked without the -X option, it will switch to the > alternate screen, where mousewheel scrolling works by sending cursor > up/down keycodes. While in 'less', you can temporarily flip to the > main screen to look up something in the shell session there or copy > something for searching in 'less'. While looking at the main screen, > the mousewheel will scroll the scrollback buffer. Keyboard input > that's sent to 'less' will flip back to the alternate screen.
To me, this is another confirmation that (ab)using the "-X" option is something that we need to get rid of, as I already described earlier in this email thread.
Show 12 quoted lines
> Quitting 'less' switches back to the main screen, so the 'less' output > disappears and you're back in the shell session with the command that > invoked 'less' as the last thing shown. But again, the 'Flip Screen' > command or shortcuts can be used to temporarily look at or copy from > the alternate screen, which will contain the last page displayed by > 'less'. (The alternate screen does not have a scrollback buffer.) > > The 'Flip Screen' feature of course also works with other > alternate-screen applications, for example editors. > > Apparently the Mac terminal has such a feature as well: > https://support.apple.com/en-ie/guide/terminal/trmld1f46097/mac
Maybe there is some data available about how frequently this neat feature is used? It would be really good to know how much is it actually used.
> (Full disclosure: I originally made mintty, from PuTTY.)
Thanks for your work!