[Aptitude-devel] Bug#808575: Bug#808575: maybe use $PAGER when showing choices in command line mode

Axel Beckert abe at debian.org
Mon Dec 21 20:22:32 UTC 2015


Control: retitle -1 aptitude: Should use a pager to show package lists and choices in CLI mode

Hi Jidanni,

積丹尼 Dan Jacobson wrote:
>       Upgrade the following packages:
> 7)      libapt-pkg-perl [0.1.29+b4 (now) -> 0.1.29+b5 (unstable)]
> 8)      libcairo-perl [1.106-1 (now) -> 1.106-1+b1 (unstable)]
> 9)      libcommon-sense-perl [3.74-1 (now) -> 3.74-1+b1 (unstable)]
> ...
> 38)     libyaml-syck-perl [1.29-1 (now) -> 1.29-1+b1 (unstable)]
> 39)     perl-tk [1:804.033-1 (now) -> 1:804.033-1+b1 (unstable)]
> 
> Accept this solution? [Y/n/q/?] **ALSO NOTE THE BIG 3 line gap above***
> 
> Well what about the first few? They have flown off my screen.

In most terminals (at least Linux console and xterm), you can use
Shift-PageUp to scroll back. So this should be rather easy to achieve
in most cases.

> So maybe aptitude should honor PAGER?

If it would use a pager, it would honour $PAGER. But since it doesn't
even use a pager yet in this case, I assume this is a request to add
support for using a pager in such a situation, not that a specific
pager is hardcoded and $PAGER is ignored.

BTW: For viewing changelogs it _does_ honour $PAGER if set.

> The man page says
> 
>        PAGER
>            If this environment variable is set, aptitude will use it to
>            display changelogs when "aptitude changelog" is invoked. If not
>            set, it defaults to more.
> 
> so maybe it should kick in optionally also in this case.

Yeah, I like that idea. Especially for dist-upgrades from oldstable to
stable this list may be longer than the terminal's scrollback buffer.

> One notes one can still use less(1) $LESS with
> 
>        -F or --quit-if-one-screen
>               Causes less to automatically exit if the entire file can be dis-
>               played on the first screen.

Yep. Another common less option for such cases is -X or --no-init

              Disables sending the termcap initialization and
	      deinitialization strings to the terminal. This is
	      sometimes desirable if the deinitialization string does
	      something unnecessary, like clearing the screen.

Nevertheless, aptitude uses Debian's sensible-pager by default and
falls back to "more", not "less". So adding "less -F" alike feature is
probably less trivial than it sounds.

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe at debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



More information about the Aptitude-devel mailing list