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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023-11-03 16:28, Andy Koppe wrote:
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.

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.

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.

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!




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux