FS#37818 - Pipe pacman's output into a pager
|
Details
Some pacman operations produce long output, which is usually
longer than your terminal size. You have to scroll back to
the beginning to read what you wanted. I suggest to fix this
by piping the output into a pager like 'less', when
required. Pacman should behave similar to 'git diff
master'.
The pager should only be used if: * 'Pager = /usr/bin/less' is configured in pacman.conf * no user interaction is required in the operation ( or --noconfirm is used ) * pacman is run from an interactive shell ( AFAIK pacman can already detect this.) * the number of output lines is larger than the number of terminal lines * pacman's output is not piped into another command or redirected to a file I think of operations like '-Q', '-Qet', and '-Ss', that become a lot more readable when piped into less. |
This task depends upon
$ type qil
qil is a function
qil ()
{
pacman -Qi "$@" | less
}
When the output is short enough to fit into the terminal, your function still uses a pager. Also it requires a seperate function for -Ss and -Q.
I am lazy and do not want to use different functions for the purpose of using pacman.
I would rather see this fixed in pacman, so that others benefit from it , too.
Maybe you should take a bit of time to read the less manpage and note the presence of the -F or --quit-if-one-screen options.