Completions should be paged through PAGER when `page-completions` is off

Bug #1691314 reported by Mike Doherty
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When tab completion sends output through a pager, it seemed to use more. Because less is better than more, I wanted it to use less instead, particularly so I can scroll in both directions.

I initially made /bin/more a symlink to less (which would trigger its more-emulation mode, but that's still better than actual more), but this had no effect. As a result, I consulted the man page for bash. In the section on readline, there is a setting `page-completions` which says that when on (the default), readline will use a built-in more-like pager to page the results. This doesn't specify what happens when it is turned off, but I expected that instead of the built-in pager, it would use an external on, specifically the one specified in the PAGER environment variable. However, it instead simply dumps the results in the terminal.

Please add some way to use PAGER as the pager for completion results.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: bash 4.3-14ubuntu1.1
ProcVersionSignature: Ubuntu 4.4.0-75.96-generic 4.4.59
Uname: Linux 4.4.0-75-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
CurrentDesktop: Unity
Date: Tue May 16 18:42:43 2017
InstallationDate: Installed on 2016-04-27 (384 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: bash
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Mike Doherty (doherty) wrote :
Mike Doherty (doherty)
description: updated
Revision history for this message
Nathaniel Beaver (nathanielmbeaver) wrote :

This was brought up previously on the bash mailing list in 2014:

https://lists.gnu.org/archive/html/help-bash/2014-03/msg00017.html

and then the readline mailing list:

https://lists.gnu.org/archive/html/bug-readline/2014-03/msg00044.html

and elsewhere:

https://lists.debian.org/debian-user/2014/04/msg00138.html

https://stackoverflow.com/questions/26257724/set-less-as-pager-in-psql

https://unix.stackexchange.com/questions/158269/can-we-use-something-better-than-more-for-tab-completion

But implementing an external pager is not an easy task, and so far it looks like nobody has done so.

>> I had a look at the source already, realizing that the internal paging
>> mechanism is quite entangled within readline. I even considered trying
>> a patch myself by passing the output to popen() to talk to the external
>> pager.
> I would have to see whether or not a popen-style approach would work with
> applications that want to manage the terminal in other ways, its effect on
> any signal handling applications want to do, and whether or not it would
> work in a callback-oriented application.

https://lists.gnu.org/archive/html/bug-readline/2014-03/msg00046.html

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.