Comment 7 for bug 209537

Revision history for this message
Michael B. Trausch (mtrausch) wrote :

Diffstat on attached patch, which now considers stdout's status as a tty before acting on COLUMNS:

 debian/patches/00list | 1
 debian/patches/01-check-columns-env-var.dpatch | 30 +++++++++++++++++++++++++
 diffstat-1.45/debian/changelog | 12 ++++++++++
 diffstat-1.45/debian/control | 5 ++--
 diffstat-1.45/debian/rules | 9 +++++--
 5 files changed, 53 insertions(+), 4 deletions(-)

Thinking about it more, though, I think I like dpkg's behavior, wherein COLUMNS is honored even when stdout is a process instead of a tty. For example if you run:

  COLUMNS=70 dpkg -l ubuntu-desktop | less

The output is properly formatted, whereas if you remove the COLUMNS=, you'll find that it spans nearly 140 columns. Either way, though, it works.