FS#35116 - pacman: colorful, paginated output

Attached to Project: Pacman
Opened by Przemyslaw K. (CoolGenie) - Monday, 06 May 2013, 19:02 GMT
Last edited by Allan McRae (Allan) - Monday, 22 December 2014, 03:48 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 4.1.0
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:

For commands like

pacman -S kde

it would be nice to have the output automatically piped to less, with support for color output (this behavior can be observed, for example, in the command 'git log' with colors turned on).
Currently something like

pacman -S kde | less

doesn't do the job: it's a bit too much typing and there are no colors.

Steps to Reproduce:
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 22 December 2014, 03:48 GMT
Reason for closing:  Duplicate
Additional comments about closing:  FS#37818
Comment by Dave Reisner (falconindy) - Monday, 06 May 2013, 19:19 GMT
This makes no sense. Why would you paginate output that requires user interaction?
Comment by Przemyslaw K. (CoolGenie) - Monday, 06 May 2013, 19:55 GMT
The command
pacman -S kde
does not require any user interaction: it just displays a list of packages that match the given criteria.
Pagination with color makes it a lot easier to inspect the results.
Comment by Brendan (watricky) - Monday, 06 May 2013, 20:20 GMT
I suspect you're confused about the commands:
'pacman -S <package>'
installs a package and, as Dave rightly points out, is interactive and won't benefit from pagination.

'pacman -Ss <search-query>'
lists packages

For what its worth, less *does* have a flag to allow raw control characters (such as colour control) to work: -r
For example, the following works as you desire:
pacman -S kde | less -r

I suggest this bug be closed as wontfix unless you still have a compelling reason otherwise.
Comment by Przemyslaw K. (CoolGenie) - Monday, 06 May 2013, 20:28 GMT
Ohh, I'm sorry, I meant
pacman -Ss ...
i.e. searching for a package.

The -r swith does work with pacman but only in this fashion as I just discovered:

pacman -Ss <package> --color=always | less -r

Guess I'll add an alias for this to the config, but it still would be nice to have the pagination by default.
Comment by Johannes Löthberg (demize) - Sunday, 21 December 2014, 18:20 GMT
This isn’t really something that pacman itself should do on it’s own IMO, if anything it could be done with either a simple alias or a script if you want more logic in it.

Loading...