How to use a pager with output from Mercurial

The output of many commands in Mercurial can spill beyond the height of the terminal. An external pager can be applied to this output automatically by using the pager extension that ships with Mercurial.

In the Mercurial configuration file, first enable the plugin by using the word pager and next indicate the pager program you would like it to use. For example:

pager = less

To use the pager only when the output is more than one page and to preserve the color output of Mercurial, so I use this:

pager = less --quit-if-one-screen --RAW-CONTROL-CHARS --no-init

Tried with: Mercurial 2.0.2

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.