By default, git uses less as the pager when using git commands that produce output. To disable it when using commands, you can use --no-pager or -P arguments.
$ git -P show --stat
commit 02334450b3d1d93179019d5a5dc788dd5ce15e0f (HEAD -> main)
Author: <redacted>
Date: <redacted>
add notes
notes | 1 +
1 file changed, 1 insertion(+)
$ git --no-pager show --stat