Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In git bash how to increase less's screen width?

I am using git bash 2.32 on Windows 10.

In git bash after updating to 2.32 I see strange behavior of the command I used for displaying log:

git -c core.pager='less -S -F' log --all --decorate --oneline --graph

As you can see I try to use "a dog" command with less pager configured to quit on EOF and to cut lines whose length exceed the current screen width. But after I updated to 2.32 the output appears to be truncated after 80 symbols which is usually much less than the actual screen width (as shown on the image below).

I am trying to understand how to increase that limit so that less truncates lines that are longer than say 160 symbols or rather the lines that just don't fit the current screen.

Note: I changed the width to 160 and now echo $COLUMNS returns 160 but that didn't help a bit.

Note: I also enabled checkwinsize option for the current session. Also no luck. As can be seen the lines are truncated way too early

like image 558
daniel.kish Avatar asked Jun 08 '21 13:06

daniel.kish


1 Answers

This is a relatively recent Git-for-Windows bug, with discussion and patches found here in the archives for the Git mailing list. There is a lot of further discussion in this GitHub issue. The bug is to be fixed in the next update of Git-for-Windows.

In the meantime, consider this workaround from KalleOlaviNiemitalo:

git config --global core.pager "env -u COLUMNS less"
like image 171
torek Avatar answered Oct 21 '22 09:10

torek