Differences between revisions 3 and 4
Revision 3 as of 2015-11-30 22:57:42
Size: 509
Editor: AugieFackler
Comment:
Revision 4 as of 2015-12-01 01:16:31
Size: 1075
Editor: AugieFackler
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:

=== Handling aliases ===

It [[https://github.com/git/git/blob/master/builtin/diff.c#L367|looks like]] git just hard-codes which commands use the pager. We could probably do something similar by having a paged context manager on ui, eg:

{{{
  with ui.paged:
    # all ui prints here go to the pager
}}}

or we could have a function to page the output, since I [augie] think that starting the pager isn't reversible:
{{{
  ui.pager()
  # all subsequent output goes to the pager
}}}

That'd solve the problem of [alias] entries not getting paged.

We think we'd like some sort of automatic pager support in core and on by default. This page exists to (roughly) document problems with the existing pager support, so we can outline a path to a real solution:

  1. Pager only applies to a handful of whitelisted commands, and aliases using those commands don't get paged
  2. What should the default pager configuration be?

    1. Probably less, and probably set LESS=FSRX if LESS isn't already set?

Handling aliases

It looks like git just hard-codes which commands use the pager. We could probably do something similar by having a paged context manager on ui, eg:

  with ui.paged:
    # all ui prints here go to the pager

or we could have a function to page the output, since I [augie] think that starting the pager isn't reversible:

  ui.pager()
  # all subsequent output goes to the pager

That'd solve the problem of [alias] entries not getting paged.


CategoryDeveloper CategoryNewFeatures

PagerInCorePlan (last edited 2017-12-06 21:37:58 by AugieFackler)