# .gitconfig: -c core.pager='less -+F -+X' status

3 messages from 2023-03-21 to 2023-03-21. Participants: Alejandro Colomar, Jeff King.
Thread: https://gitlist.dev/t/59428

## Alejandro Colomar, 2023-03-21 14:24

Subject: .gitconfig: -c core.pager='less -+F -+X' status
Message-ID: <92e2b9d2-e259-6bba-7080-28a01c0d323c@gmail.com>
URL: https://gitlist.dev/e/92e2b9d2-e259-6bba-7080-28a01c0d323c%40gmail.com

```
Hi,

I wrote recently some aliases to not clutter my screen when I want to
check something quick:

$ head -n4 ~/.gitconfig 
[alias]
	df = -c core.pager='less -+F -+X' diff
	sw = -c core.pager='less -+F -+X' show
	st = -c core.pager='less -+F -+X' status

Now, `git df` and `git sw` work as expected: they open a less window,
and it's later closed with `q`, with no traces in my screen except for
the command itself.  

However, `git st` doesn't seem to work.  It prints everything to screen,
and then exits.

You can reproduce it on the command line too:

git -c core.pager='less -+F -+X' diff    # OK
git -c core.pager='less -+F -+X' show    # OK
git -c core.pager='less -+F -+X' status  # Not OK

Cheers,
Alex

P.S.:  While sometimes I want to check quick something without
cluttering my screen, I don't recommend anyone reading this to run these
aliases as a norm.  I prefer using the ones that leave traces on the
screen, since that way it's simple to recover from rebase accidents,
which at least to me, happen rather often.  This is only for cases where
I have something important on the screen which I don't want to hide
(previously, I would open a new terminal to check something quick on
git).

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

```

## Jeff King, 2023-03-21 18:42

Subject: Re: .gitconfig: -c core.pager='less -+F -+X' status
Message-ID: <20230321184210.GM3119834@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20230321184210.GM3119834%40coredump.intra.peff.net
In-Reply-To: <92e2b9d2-e259-6bba-7080-28a01c0d323c@gmail.com>

```
On Tue, Mar 21, 2023 at 03:24:53PM +0100, Alejandro Colomar wrote:

> Hi,
> 
> I wrote recently some aliases to not clutter my screen when I want to
> check something quick:
> 
> $ head -n4 ~/.gitconfig 
> [alias]
> 	df = -c core.pager='less -+F -+X' diff
> 	sw = -c core.pager='less -+F -+X' show
> 	st = -c core.pager='less -+F -+X' status
> 
> Now, `git df` and `git sw` work as expected: they open a less window,
> and it's later closed with `q`, with no traces in my screen except for
> the command itself.  
> 
> However, `git st` doesn't seem to work.  It prints everything to screen,
> and then exits.

git-status doesn't invoke the pager by default:

  $ git -c core.pager='echo foo' log
  foo

  $ git -c core.pager='echo foo' status
  On branch [...etc]

You can configure it to do so:

  git config --global pager.status true

Or if you just want it to happen in your alias, try:

  [alias]
      st = -p -c core.pager='less -+F -+X' status

-Peff

```

## Alejandro Colomar, 2023-03-21 19:22

Subject: Re: .gitconfig: -c core.pager='less -+F -+X' status
Message-ID: <6a1bea28-ed50-f32b-35ef-ef12f16e2878@gmail.com>
URL: https://gitlist.dev/e/6a1bea28-ed50-f32b-35ef-ef12f16e2878%40gmail.com
In-Reply-To: <20230321184210.GM3119834@coredump.intra.peff.net>

```
Hi Jeff,

On 3/21/23 19:42, Jeff King wrote:
> On Tue, Mar 21, 2023 at 03:24:53PM +0100, Alejandro Colomar wrote:
> 
>> Hi,
>>
>> I wrote recently some aliases to not clutter my screen when I want to
>> check something quick:
>>
>> $ head -n4 ~/.gitconfig 
>> [alias]
>> 	df = -c core.pager='less -+F -+X' diff
>> 	sw = -c core.pager='less -+F -+X' show
>> 	st = -c core.pager='less -+F -+X' status
>>
>> Now, `git df` and `git sw` work as expected: they open a less window,
>> and it's later closed with `q`, with no traces in my screen except for
>> the command itself.  
>>
>> However, `git st` doesn't seem to work.  It prints everything to screen,
>> and then exits.
> 
> git-status doesn't invoke the pager by default:

Ahh, sorry, how could I forget something like that =)
Probably some brainfart here between chair and keyboard.

> 
>   $ git -c core.pager='echo foo' log
>   foo
> 
>   $ git -c core.pager='echo foo' status
>   On branch [...etc]
> 
> You can configure it to do so:
> 
>   git config --global pager.status true

Hmm, I like this.  When status grows hundreds of lines, it's nice if
it only shows the first screen by default.

Thanks!

Alex

> 
> Or if you just want it to happen in your alias, try:
> 
>   [alias]
>       st = -p -c core.pager='less -+F -+X' status

> 
> -Peff

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

```
