What does “~ (END)” mean when displayed in a terminal?

I'm running through the gitimmersion.com labs and every time I run a: git hist --all command it seems to break terminal and throw this:

~
~
~
~
(END)

and I'm not able to type any more commands. So I end up closing that terminal window and starting over.

Anyone know why this happens and how to resolve it?

Thanks!


Solution 1:

Git pipes long output into what's called a pager by default, which can make it easier to view the output if it doesn't fit on a screen. The ~ characters indicate that those lines were not in the original output, but it's showing them so that you can scroll down past the bottom (i.e. the last line of output can go up to the top of the screen).

You typically can use the arrow keys to scroll up or down, and can exit by pressing q.


Alternatively, if you don't want the output in a pager, try this:

$ git --no-pager hist --all

Solution 2:

Taken from git help config

  core.pager
       The command that git will use to paginate output. Can be overridden with the GIT_PAGER environment variable.
       Note that git sets the LESS environment variable to FRSX if it is unset when it runs the pager. One can
       change these settings by setting the LESS variable to some other value. Alternately, these settings can be
       overridden on a project or global basis by setting the core.pager option. Setting core.pager has no affect
       on the LESS environment variable behaviour above, so if you want to override git’s default settings this
       way, you need to be explicit. For example, to disable the S option in a backward compatible manner, set
       core.pager to less -+$LESS -FRX. This will be passed to the shell by git, which will translate the final
       command to LESS=FRSX less -+FRSX -FRX.

To skip a pager completely:

git config --global core.pager cat

The -F flag to less is nice as it tells less to not page the output if it fits on one page.