Suggested fix lp:#213718 (bazaar pager)

Daniel Vedder d.vedder at web.de
Fri Apr 10 18:02:13 UTC 2015


Hello everyone,

here is a suggested fix for Launchpad bug #213718
(https://bugs.launchpad.net/bzr/+bug/213718).

The cause for complaint was that many 'bzr help' commands yield a long
output, which some users would like to view in a pager, especially if
their terminal does not support scrolling.

The attached patch creates a configuration option 'pager' which can be
set in the user's bazaar.conf file (analogously to the 'editor' option).
If this option is set, and it has been passed a long output text (> 23
lines), TextUIOutputStream will pipe the output into the specified pager
utility instead of printing to stdout.

Currently the output of 'bzr log' and 'bzr config' does not get
redirected to the pager, as the relevant modules call write() once every
line instead of amalgamating the entire output into a single string or
string array and writing that. Thus the individual lines slip through
the length check and the pager is not invoked. As far as I can see,
changing this would require some major refactoring in the affected
modules, so I have not (yet) done it.

I'm just a young hobby programmer with no prior open-source development
experience, so I have probably left out something or the other that I
ought still to have done. Any pointers, help and suggestions for
improvement would be gratefully received :-) (For example, I updated the
documentation, but I don't quite understand how to write a test for the
pager functionality.)

Greetings,
Daniel


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-pager.patch
Type: text/x-patch
Size: 278803 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20150410/13f2f321/attachment-0001.bin>


More information about the bazaar mailing list