Package: dpkg
Version: 1.19.1

I upgraded dpkg today and noticed that 'dpkg -l' now always pipes its output
through less, even if $PAGER is unset.  The only way to get the output to go
to the tty is to explicitly pipe it to cat.

This is exactly the opposite of how unix programs should behave - stdout
goes to a tty unless redirected.  If a user **wants** to view the output of
a program in a pager, then they can pipe it to less or whatever themselves.
That's standard usage of the unix shell.  Hard-coding a program to always use
a pager is wrong.

It also prevents dpkg's output from appearing in the scrollback buffer of
terminal emulators because less (by default) switches to the alternate screen.


dpkg now also ignore the COLUMNS variable, which is set by default in bash
and other shells, and can be overidden on the command line as needed. With
this change, flexibility and customisation has been replaced with a single
hard-coded output format.  Previous versions of dpkg used $COLUMNS, and were
documented to do so in the man page.

This makes the output ugly and difficult to read on standard 80 column
terminals because the output will now typically be longer than 80 columns
wide.  In fact, it's ugly and difficult to read on any terminal width
less than the widest possible output line - it's no longer an easily read
one-line-per-entry table, but a jumbled multiple-lines-per-entry mess.



Looking through the changelog, this seems to be an attempt to "solve" #898603
which was a non-problem that didn't need fixing.  Unfortunately, the solution
hard-codes one individual's personal preference as the only possible behaviour
of dpkg -l.

There were already several methods available to that user to get the output
they preferred.  They could have piped to cat (or 'less -S', or whatever)
as they already knew how to do. or they could have set the COLUMNS variable
before running dpkg, e.g.

    $ COLUMNS=132 dpkg -l pkg1 pkg2 pkg3 ...



Please revert this change.

or, at least, modify it to use a DPKG_PAGER environment variable (and maybe
DPKG_PAGER_OPTIONS for overriding the pager's default options).

Better yet, make it configureable in /etc/dpkg/dpkg.cfg (I don't care what the
default is as long as I can unset it or comment it out - without having to set
it to cat)

or add a -w or --wide option to dpkg.  That would have been
backwards-compatible with existing behaviour and expectations.

or all of the above.


craig

ps: my own dlocate program solved a similar issue with a '-c' option:

       -c, --columns[=columns]

              Set COLUMN width to override the dlocate default of using the
              entire terminal line width.  Any value for columns less than 80
              will be increaed to 80.

Actually, this solved pretty much the exact opposite issue - it exists because
my terminal is usually at least 250 characters wide (max width on a 1440p
monitor, useful for viewing log files) and I sometimes want to restrict the
output to 80 columns for email, or 132 columns just so it's not so damn wide.

--
craig sanders <[email protected]>

Reply via email to